Power on LED in bottom right corner, if no GPS
This commit is contained in:
parent
891bfe0478
commit
3ee9d5b0e6
1 changed files with 8 additions and 1 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue