Power on LED in bottom right corner, if no GPS

This commit is contained in:
Jonas Leder 2023-06-27 22:55:12 +02:00
commit 3ee9d5b0e6

View file

@ -21,6 +21,7 @@ unsigned long lastColonUpdate = 0;
bool colonOn = false;
bool validTime = false;
bool validDate = false;
bool displayGpsInfo = false;
String lastDisplayedTime;
Adafruit_Protomatter matrix(
@ -112,6 +113,9 @@ void loop()
matrix.drawPixel(x, y, color);
}
}
if(displayGpsInfo) {
matrix.drawPixel(63, 31, 0x0001);
}
matrix.show();
}
@ -128,12 +132,15 @@ void loop()
Serial.flush();
if (gps.encode(c))
{
if (gps.time.isValid() && gps.time.hour() != 0 && gps.time.minute())
if (gps.time.isValid() && gps.time.hour() != 0 && gps.time.minute() != 0)
{
Hour = gps.time.hour();
Minute = gps.time.minute();
Second = gps.time.second();
validTime = true;
displayGpsInfo = false;
} else {
displayGpsInfo = true;
}
if (gps.date.isValid() && gps.date.day() != 0 && gps.date.month() != 0 && gps.date.year() != 2000)
{