update serial print messages

This commit is contained in:
Kyle Gabriel 2019-08-26 18:05:23 -04:00
parent 6b073a2136
commit 468c0dbeae

View File

@ -72,10 +72,20 @@ static void gps_loop() {
{ {
LatitudeBinary = ((_gps.location.lat() + 90) / 180.0) * 16777215; LatitudeBinary = ((_gps.location.lat() + 90) / 180.0) * 16777215;
LongitudeBinary = ((_gps.location.lng() + 180) / 360.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()); sprintf(t, "Lat: %f", _gps.location.lat());
Serial.println(t); Serial.println(t);
sprintf(t, "Lng: %f", _gps.location.lng()); sprintf(t, "Lng: %f", _gps.location.lng());
Serial.println(t); 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[0] = ( LatitudeBinary >> 16 ) & 0xFF;
txBuffer[1] = ( LatitudeBinary >> 8 ) & 0xFF; txBuffer[1] = ( LatitudeBinary >> 8 ) & 0xFF;
@ -83,12 +93,9 @@ static void gps_loop() {
txBuffer[3] = ( LongitudeBinary >> 16 ) & 0xFF; txBuffer[3] = ( LongitudeBinary >> 16 ) & 0xFF;
txBuffer[4] = ( LongitudeBinary >> 8 ) & 0xFF; txBuffer[4] = ( LongitudeBinary >> 8 ) & 0xFF;
txBuffer[5] = LongitudeBinary & 0xFF; txBuffer[5] = LongitudeBinary & 0xFF;
altitudeGps = _gps.altitude.meters();
txBuffer[6] = ( altitudeGps >> 8 ) & 0xFF; txBuffer[6] = ( altitudeGps >> 8 ) & 0xFF;
txBuffer[7] = altitudeGps & 0xFF; txBuffer[7] = altitudeGps & 0xFF;
hdopGps = _gps.hdop.value() / 10;
txBuffer[8] = hdopGps & 0xFF; txBuffer[8] = hdopGps & 0xFF;
sats = _gps.satellites.value();
txBuffer[9] = sats & 0xFF; txBuffer[9] = sats & 0xFF;
} }