added timestamps to gps reading

pico-payload-gps
alanbjohnston 3 years ago committed by GitHub
parent 80a0abdf41
commit 2ba52a594b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3100,6 +3100,7 @@ void payload_OK_only()
// For one second we parse GPS data and report some key values
newData = false;
unsigned long starting = millis()
for (unsigned long start = millis(); millis() - start < 1000;) // 1000;)
{
while (Serial2.available())
@ -3113,14 +3114,17 @@ void payload_OK_only()
}
if (newData)
{
Serial.printf("GPS read new data in ms: %d\n", millis() - start);
float flon, flat;
unsigned long age;
starting = millis();
gps.f_get_position(&flat, &flon, &age);
Sensor1 = flat;
Sensor2 = flon;
Sensor3 = (float) gps.altitude()/100.0;
Serial.printf("New GPS data: %f %f %f \n", Sensor1, Sensor2, Sensor3);
}
Serial.printf("New GPS data: %f %f %f ms: \n", Sensor1, Sensor2, Sensor3, millis() - starting);
} else
Serial.printf("GPS read no new data: %d\n", millis() - start);
blink(50);

Loading…
Cancel
Save

Powered by TurnKey Linux.