diff --git a/main/gps.ino b/main/gps.ino index 27a0fb2..ca40a8f 100644 --- a/main/gps.ino +++ b/main/gps.ino @@ -72,10 +72,20 @@ static void gps_loop() { { LatitudeBinary = ((_gps.location.lat() + 90) / 180.0) * 16777215; LongitudeBinary = ((_gps.location.lng() + 180) / 360.0) * 16777215; + altitudeGps = _gps.altitude.meters(); + hdopGps = _gps.hdop.value() / 10; + sats = _gps.satellites.value(); + sprintf(t, "Lat: %f", _gps.location.lat()); Serial.println(t); sprintf(t, "Lng: %f", _gps.location.lng()); Serial.println(t); + sprintf(t, "Alt: %f", altitudeGps); + Serial.println(t); + sprintf(t, "Hdop: %d", hdopGps); + Serial.println(t); + sprintf(t, "Sats: %d", sats); + Serial.println(t); txBuffer[0] = ( LatitudeBinary >> 16 ) & 0xFF; txBuffer[1] = ( LatitudeBinary >> 8 ) & 0xFF; @@ -83,12 +93,9 @@ static void gps_loop() { txBuffer[3] = ( LongitudeBinary >> 16 ) & 0xFF; txBuffer[4] = ( LongitudeBinary >> 8 ) & 0xFF; txBuffer[5] = LongitudeBinary & 0xFF; - altitudeGps = _gps.altitude.meters(); txBuffer[6] = ( altitudeGps >> 8 ) & 0xFF; txBuffer[7] = altitudeGps & 0xFF; - hdopGps = _gps.hdop.value() / 10; txBuffer[8] = hdopGps & 0xFF; - sats = _gps.satellites.value(); txBuffer[9] = sats & 0xFF; }