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:
2019-05-30 11:36:13 +02:00
parent 0d3896ca0d
commit adb03d486b
3 changed files with 15 additions and 2 deletions

View File

@ -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);