You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/Data_Logging/DataLoggingExample1_NAV_PVT/DataLoggingExample1_NAV_PVT.ino
+15-15
Original file line number
Diff line number
Diff line change
@@ -46,8 +46,8 @@
46
46
#include<SD.h>
47
47
#include<Wire.h>//Needed for I2C to GNSS
48
48
49
-
#include<SparkFun_Ublox_Arduino_Library.h>//Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS
50
-
SFE_UBLOX_GPS myGPS;
49
+
#include<SparkFun_u-blox_GNSS_Arduino_Library.h>//Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS
50
+
SFE_UBLOX_GNSS myGNSS;
51
51
52
52
File myFile; //File that all GNSS data is written to
53
53
@@ -150,46 +150,46 @@ void setup()
150
150
while (1);
151
151
}
152
152
153
-
//myGPS.enableDebugging(); // Uncomment this line to enable helpful GNSS debug messages on Serial
153
+
//myGNSS.enableDebugging(); // Uncomment this line to enable helpful GNSS debug messages on Serial
154
154
155
155
// NAV PVT messages are 100 bytes long.
156
156
// In this example, the data will arrive no faster than one message per second.
157
157
// So, setting the file buffer size to 301 bytes should be more than adequate.
158
158
// I.e. room for three messages plus an empty tail byte.
159
-
myGPS.setFileBufferSize(301); // setFileBufferSize must be called _before_ .begin
159
+
myGNSS.setFileBufferSize(301); // setFileBufferSize must be called _before_ .begin
160
160
161
-
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
161
+
if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
162
162
{
163
163
Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing..."));
164
164
while (1);
165
165
}
166
166
167
167
// Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate
168
168
// (This will also disable any "auto" messages that were enabled and saved by other examples and reduce the load on the I2C bus)
169
-
//myGPS.factoryDefault(); delay(5000);
169
+
//myGNSS.factoryDefault(); delay(5000);
170
170
171
-
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
172
-
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
171
+
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
172
+
myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
173
173
174
-
myGPS.setNavigationFrequency(1); //Produce one navigation solution per second
174
+
myGNSS.setNavigationFrequency(1); //Produce one navigation solution per second
175
175
176
-
myGPS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
176
+
myGNSS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
177
177
178
-
myGPS.logNAVPVT(); // Enable NAV PVT data logging
178
+
myGNSS.logNAVPVT(); // Enable NAV PVT data logging
179
179
180
180
Serial.println(F("Press any key to stop logging."));
181
181
}
182
182
183
183
voidloop()
184
184
{
185
-
myGPS.checkUblox(); // Check for the arrival of new data and process it.
186
-
myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
185
+
myGNSS.checkUblox(); // Check for the arrival of new data and process it.
186
+
myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
187
187
188
-
if (myGPS.fileBufferAvailable() >= packetLength) // Check to see if a new packetLength-byte NAV PVT message has been stored
188
+
if (myGNSS.fileBufferAvailable() >= packetLength) // Check to see if a new packetLength-byte NAV PVT message has been stored
189
189
{
190
190
uint8_t myBuffer[packetLength]; // Create our own buffer to hold the data while we write it to SD card
191
191
192
-
myGPS.extractFileBufferData((uint8_t *)&myBuffer, packetLength); // Extract exactly packetLength bytes from the UBX file buffer and put them into myBuffer
192
+
myGNSS.extractFileBufferData((uint8_t *)&myBuffer, packetLength); // Extract exactly packetLength bytes from the UBX file buffer and put them into myBuffer
193
193
194
194
myFile.write(myBuffer, packetLength); // Write exactly packetLength bytes from myBuffer to the ubxDataFile on the SD card
0 commit comments