The inverted clock now also comes with a blinking colon.
This commit is contained in:
parent
7a7c17ede5
commit
22b45d3342
25
effects.h
25
effects.h
@ -86,22 +86,25 @@ class Clock : public Effect {
|
|||||||
} else {
|
} else {
|
||||||
// Manually clear the needed parts
|
// Manually clear the needed parts
|
||||||
for(int i=0; i<window.w; i++) setPixel(window, i, 0, bg_color);
|
for(int i=0; i<window.w; i++) setPixel(window, i, 0, bg_color);
|
||||||
for(int i=0; i<5; i++) {
|
for(int y=0; y<6; y++) {
|
||||||
setPixel(window, 3, i, bg_color);
|
setPixel(window, 3, y, bg_color);
|
||||||
setPixel(window, 7, i, bg_color);
|
if (y!=2 && y!=4) {
|
||||||
setPixel(window, 8, i, bg_color);
|
setPixel(window, 7, y, bg_color);
|
||||||
setPixel(window, 12, i, bg_color);
|
}
|
||||||
|
setPixel(window, 8, y, bg_color);
|
||||||
|
setPixel(window, 12, y, bg_color);
|
||||||
}
|
}
|
||||||
|
fg_color = bg_color;
|
||||||
}
|
}
|
||||||
int h = ntpClient.getHours();
|
int h = ntpClient.getHours();
|
||||||
drawDigit(window, numbers3x5, 3, 5, 0, 1, h / 10, invert ? bg_color : fg_color, invert);
|
drawDigit(window, numbers3x5, 3, 5, 0, 1, h / 10, fg_color, invert);
|
||||||
drawDigit(window, numbers3x5, 3, 5, 4, 1, h % 10, invert ? bg_color : fg_color, invert);
|
drawDigit(window, numbers3x5, 3, 5, 4, 1, h % 10, fg_color, invert);
|
||||||
int m = ntpClient.getMinutes();
|
int m = ntpClient.getMinutes();
|
||||||
drawDigit(window, numbers3x5, 3, 5, 9, 1, m / 10, invert ? bg_color : fg_color, invert);
|
drawDigit(window, numbers3x5, 3, 5, 9, 1, m / 10, fg_color, invert);
|
||||||
drawDigit(window, numbers3x5, 3, 5, 13, 1, m % 10, invert ? bg_color : fg_color, invert);
|
drawDigit(window, numbers3x5, 3, 5, 13, 1, m % 10, fg_color, invert);
|
||||||
if (ntpClient.getSeconds() & 1) {
|
if (ntpClient.getSeconds() & 1) {
|
||||||
setPixel(window, 7, 2, invert ? bg_color : fg_color);
|
setPixel(window, 7, 2, fg_color);
|
||||||
setPixel(window, 7, 4, invert ? bg_color : fg_color);
|
setPixel(window, 7, 4, fg_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user