6
6
License: MIT. Please see LICENSE.md for more information.
7
7
8
8
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
10
10
serial UARTs should be compatible.
11
11
12
12
Note: Lat/Lon are doubles and the UM980 outputs 11 digits after the decimal.
@@ -67,11 +67,11 @@ void loop()
67
67
// By default, this data is updated once per second.
68
68
69
69
Serial.print (" Lat/Long/Alt: " );
70
- Serial.print (myGNSS.getLatitude (), 11 );
70
+ Serial.print (myGNSS.getLatitude (), 11 ); // Accurate 11 decimal places
71
71
Serial.print (" /" );
72
72
Serial.print (myGNSS.getLongitude (), 11 );
73
73
Serial.print (" /" );
74
- Serial.print (myGNSS.getAltitude (), 4 );
74
+ Serial.print (myGNSS.getAltitude (), 4 ); // Accurate to 4 decimal places
75
75
Serial.println ();
76
76
77
77
Serial.print (" Horizontal Speed: " );
@@ -86,15 +86,32 @@ void loop()
86
86
Serial.print (" Date (yyyy/mm/dd): " );
87
87
Serial.print (myGNSS.getYear ());
88
88
Serial.print (" /" );
89
+ if (myGNSS.getMonth () < 10 )
90
+ Serial.print (" 0" );
89
91
Serial.print (myGNSS.getMonth ());
90
92
Serial.print (" /" );
93
+ if (myGNSS.getDay () < 10 )
94
+ Serial.print (" 0" );
91
95
Serial.print (myGNSS.getDay ());
96
+
92
97
Serial.print (" Time (hh:mm:dd): " );
98
+ if (myGNSS.getHour () < 10 )
99
+ Serial.print (" 0" );
93
100
Serial.print (myGNSS.getHour ());
94
101
Serial.print (" :" );
102
+ if (myGNSS.getMinute () < 10 )
103
+ Serial.print (" 0" );
95
104
Serial.print (myGNSS.getMinute ());
96
105
Serial.print (" :" );
106
+ if (myGNSS.getSecond () < 10 )
107
+ Serial.print (" 0" );
97
108
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 ());
98
115
Serial.println ();
99
116
100
117
Serial.print (" Satellites in view: " );
0 commit comments