66 License: MIT. Please see LICENSE.md for more information.
77
88 This example shows how to query a UM980 GNSS module for its position and time data.
9- These examples are targeted for an ESP32 platform but any platform that has multiple
9+ These examples are targeted for an ESP32 platform but any platform that has multiple
1010 serial UARTs should be compatible.
1111
1212 Note: Lat/Lon are doubles and the UM980 outputs 11 digits after the decimal.
@@ -67,11 +67,11 @@ void loop()
6767 // By default, this data is updated once per second.
6868
6969 Serial.print (" Lat/Long/Alt: " );
70- Serial.print (myGNSS.getLatitude (), 11 );
70+ Serial.print (myGNSS.getLatitude (), 11 ); // Accurate 11 decimal places
7171 Serial.print (" /" );
7272 Serial.print (myGNSS.getLongitude (), 11 );
7373 Serial.print (" /" );
74- Serial.print (myGNSS.getAltitude (), 4 );
74+ Serial.print (myGNSS.getAltitude (), 4 ); // Accurate to 4 decimal places
7575 Serial.println ();
7676
7777 Serial.print (" Horizontal Speed: " );
@@ -86,15 +86,32 @@ void loop()
8686 Serial.print (" Date (yyyy/mm/dd): " );
8787 Serial.print (myGNSS.getYear ());
8888 Serial.print (" /" );
89+ if (myGNSS.getMonth () < 10 )
90+ Serial.print (" 0" );
8991 Serial.print (myGNSS.getMonth ());
9092 Serial.print (" /" );
93+ if (myGNSS.getDay () < 10 )
94+ Serial.print (" 0" );
9195 Serial.print (myGNSS.getDay ());
96+
9297 Serial.print (" Time (hh:mm:dd): " );
98+ if (myGNSS.getHour () < 10 )
99+ Serial.print (" 0" );
93100 Serial.print (myGNSS.getHour ());
94101 Serial.print (" :" );
102+ if (myGNSS.getMinute () < 10 )
103+ Serial.print (" 0" );
95104 Serial.print (myGNSS.getMinute ());
96105 Serial.print (" :" );
106+ if (myGNSS.getSecond () < 10 )
107+ Serial.print (" 0" );
97108 Serial.print (myGNSS.getSecond ());
109+ Serial.print (" ." );
110+ if (myGNSS.getMillisecond () < 100 )
111+ Serial.print (" 0" );
112+ if (myGNSS.getMillisecond () < 10 )
113+ Serial.print (" 0" );
114+ Serial.print (myGNSS.getMillisecond ());
98115 Serial.println ();
99116
100117 Serial.print (" Satellites in view: " );
0 commit comments