Adding seconds in order to blink colon in time

This commit is contained in:
Sébastien Vallée 2017-12-22 12:27:08 +01:00
parent 0e8754512a
commit ca5ffc2b84

View File

@ -79,8 +79,10 @@ void loop() {
String time = String(ctime(&now)); String time = String(ctime(&now));
time.trim(); time.trim();
time.substring(11,19).toCharArray(time_value, 10); time.substring(11,19).toCharArray(time_value, 10);
int seconds = time.substring(17,19).toInt();
//Serial.println(seconds);
for (int i = 0; i <= 4; i++) { for (int i = 0; i <= 4; i++) {
matrix.drawChar(i*6+2,0, time_value[i], HIGH,LOW,1); // H if (i != 2 || seconds % 2 == 0) matrix.drawChar(i*6+2,0, time_value[i], HIGH,LOW,1);
} }
matrix.write(); // Send bitmap to display matrix.write(); // Send bitmap to display
if (message != "") { if (message != "") {