Kinda fixed big_clock effect, but it doesn't look nearly as cool as I'd hoped... So this commit includes the fix and the next commit will be a revert to the older, non-subsampled code, which just looked better.

This commit is contained in:
Fabian Schlenz 2019-09-25 19:31:07 +02:00
parent 937850c90a
commit 1c1c3a8054

View File

@ -29,8 +29,10 @@ void BigClockEffect::_draw_seconds() {
} }
uint16_t millis = ntpClient.getEpochMillis() % 1000; uint16_t millis = ntpClient.getEpochMillis() % 1000;
if (millis > 0) { if (millis > 0) {
uint16_t position = ((60 - (60 - seconds) * millis) << 8) / 1000; //uint16_t position = ((60 - (60 - seconds) * millis) << 8) / 1000;
//uint8_t position = 60 - ((60 - seconds) * millis / 1000); //uint8_t position = 60 - ((60 - seconds) * millis / 1000);
//percent = seconds00 - (59-seconds)ff
uint16_t position = ((seconds<<8) + (((60 - seconds)<<8) * millis / 1000));
_draw_border_pixel(position>>8, position&0xFF, &_color_seconds); _draw_border_pixel(position>>8, position&0xFF, &_color_seconds);
} }
} }
@ -42,9 +44,9 @@ void BigClockEffect::_draw_border_pixel(uint8_t i, uint8_t part, CRGB* color) {
y = 0; y = 0;
} else if (i<=23) { } else if (i<=23) {
x = 15 << 8; x = 15 << 8;
y = (i - 8) << 8 | (255 - part); y = (i - 10) << 8 | (255 - part);
} else if (i<= 38) { } else if (i<= 38) {
x = (15 - i + 23) << 8 | (255 - part); x = (15 - 1 - i + 23) << 8 | (255 - part);
y = 15 << 8; y = 15 << 8;
} else if (i <= 53) { } else if (i <= 53) {
x = 0; x = 0;