NTPClient has now a method boolean isTimeValid()
which indicates whether the last update was successful or not. Clock will blink if it wasn't successful.
This commit is contained in:
@ -24,6 +24,10 @@ void ClockEffect::loop(boolean invert, CRGB fg_color, CRGB bg_color) {
|
||||
}
|
||||
fg_color = bg_color;
|
||||
}
|
||||
if (ntpClient.getTimeValid()==false && ntpClient.getSeconds() & 1==0) {
|
||||
clear(window, bg_color);
|
||||
return;
|
||||
}
|
||||
int h = ntpClient.getHours();
|
||||
drawDigit(window, numbers3x5, 3, 5, 0, 1, h / 10, fg_color, invert);
|
||||
drawDigit(window, numbers3x5, 3, 5, 4, 1, h % 10, fg_color, invert);
|
||||
|
Reference in New Issue
Block a user