Skip to content

Commit 627fc27

Browse files
committed
Updating examples: change class name & update header file
1 parent 2d0307f commit 627fc27

File tree

62 files changed

+856
-856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+856
-856
lines changed

examples/Callbacks/CallbackExample1_NAV_PVT/CallbackExample1_NAV_PVT.ino

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
#include <Wire.h> //Needed for I2C to GPS
2525

26-
#include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
27-
SFE_UBLOX_GPS myGPS;
26+
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
27+
SFE_UBLOX_GNSS myGNSS;
2828

2929
// Callback: printPVTdata will be called when new NAV PVT data arrives
3030
// See u-blox_structs.h for the full definition of UBX_NAV_PVT_data_t
@@ -78,26 +78,26 @@ void setup()
7878

7979
Wire.begin();
8080

81-
//myGPS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
81+
//myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
8282

83-
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
83+
if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
8484
{
8585
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
8686
while (1);
8787
}
8888

89-
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
90-
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
89+
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
90+
myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
9191

92-
myGPS.setNavigationFrequency(2); //Produce two solutions per second
92+
myGNSS.setNavigationFrequency(2); //Produce two solutions per second
9393

94-
myGPS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
94+
myGNSS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
9595
}
9696

9797
void loop()
9898
{
99-
myGPS.checkUblox(); // Check for the arrival of new data and process it.
100-
myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
99+
myGNSS.checkUblox(); // Check for the arrival of new data and process it.
100+
myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
101101

102102
Serial.print(".");
103103
delay(50);

examples/Callbacks/CallbackExample2_NAV_ODO/CallbackExample2_NAV_ODO.ino

+11-11
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
#include <Wire.h> //Needed for I2C to GPS
2525

26-
#include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
27-
SFE_UBLOX_GPS myGPS;
26+
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
27+
SFE_UBLOX_GNSS myGNSS;
2828

2929
// Callback: printODOdata will be called when new NAV ODO data arrives
3030
// See u-blox_structs.h for the full definition of UBX_NAV_ODO_data_t
@@ -61,28 +61,28 @@ void setup()
6161

6262
Wire.begin();
6363

64-
//myGPS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
64+
//myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
6565

66-
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
66+
if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
6767
{
6868
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
6969
while (1);
7070
}
7171

72-
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
73-
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
72+
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
73+
myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
7474

75-
myGPS.setNavigationFrequency(1); //Produce one solution per second
75+
myGNSS.setNavigationFrequency(1); //Produce one solution per second
7676

77-
//myGPS.resetOdometer(); //Uncomment this line to reset the odometer
77+
//myGNSS.resetOdometer(); //Uncomment this line to reset the odometer
7878

79-
myGPS.setAutoNAVODOcallback(&printODOdata); // Enable automatic NAV ODO messages with callback to printODOdata
79+
myGNSS.setAutoNAVODOcallback(&printODOdata); // Enable automatic NAV ODO messages with callback to printODOdata
8080
}
8181

8282
void loop()
8383
{
84-
myGPS.checkUblox(); // Check for the arrival of new data and process it.
85-
myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
84+
myGNSS.checkUblox(); // Check for the arrival of new data and process it.
85+
myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
8686

8787
Serial.print(".");
8888
delay(50);

examples/Callbacks/CallbackExample3_TIM_TM2/CallbackExample3_TIM_TM2.ino

+10-10
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636

3737
#include <Wire.h> //Needed for I2C to GPS
3838

39-
#include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
40-
SFE_UBLOX_GPS myGPS;
39+
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
40+
SFE_UBLOX_GNSS myGNSS;
4141

4242
int dotsPrinted = 0; // Print dots in rows of 50 while waiting for a TIM TM2 message
4343

@@ -84,26 +84,26 @@ void setup()
8484

8585
Wire.begin();
8686

87-
//myGPS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
87+
//myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
8888

89-
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
89+
if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
9090
{
9191
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
9292
while (1);
9393
}
9494

95-
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
96-
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
95+
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
96+
myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
9797

98-
myGPS.setNavigationFrequency(1); //Produce one solution per second
98+
myGNSS.setNavigationFrequency(1); //Produce one solution per second
9999

100-
myGPS.setAutoTIMTM2callback(&printTIMTM2data); // Enable automatic TIM TM2 messages with callback to printTIMTM2data
100+
myGNSS.setAutoTIMTM2callback(&printTIMTM2data); // Enable automatic TIM TM2 messages with callback to printTIMTM2data
101101
}
102102

103103
void loop()
104104
{
105-
myGPS.checkUblox(); // Check for the arrival of new data and process it.
106-
myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
105+
myGNSS.checkUblox(); // Check for the arrival of new data and process it.
106+
myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
107107

108108
Serial.print(".");
109109
delay(50);

examples/Callbacks/CallbackExample4_HNR/CallbackExample4_HNR.ino

+12-12
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
#include <Wire.h> //Needed for I2C to GPS
3030

31-
#include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
32-
SFE_UBLOX_GPS myGPS;
31+
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
32+
SFE_UBLOX_GNSS myGNSS;
3333

3434
// Callback: printHNRATTdata will be called when new HNR ATT data arrives
3535
// See u-blox_structs.h for the full definition of UBX_HNR_ATT_data_t
@@ -81,36 +81,36 @@ void setup()
8181

8282
Wire.begin();
8383

84-
//myGPS.enableDebugging(); // Uncomment this line to enable debug messages on Serial
84+
//myGNSS.enableDebugging(); // Uncomment this line to enable debug messages on Serial
8585

86-
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
86+
if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
8787
{
8888
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
8989
while (1);
9090
}
9191

92-
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
93-
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
92+
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
93+
myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
9494

95-
if (myGPS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz
95+
if (myGNSS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz
9696
Serial.println(F("setHNRNavigationRate was successful"));
9797
else
9898
Serial.println(F("setHNRNavigationRate was NOT successful"));
9999

100-
if (myGPS.setAutoHNRATTcallback(&printHNRATTdata) == true) // Enable automatic HNR ATT messages with callback to printHNRATTdata
100+
if (myGNSS.setAutoHNRATTcallback(&printHNRATTdata) == true) // Enable automatic HNR ATT messages with callback to printHNRATTdata
101101
Serial.println(F("setAutoHNRATTcallback successful"));
102102

103-
if (myGPS.setAutoHNRINScallback(&printHNRINSdata) == true) // Enable automatic HNR INS messages with callback to printHNRINSdata
103+
if (myGNSS.setAutoHNRINScallback(&printHNRINSdata) == true) // Enable automatic HNR INS messages with callback to printHNRINSdata
104104
Serial.println(F("setAutoHNRINScallback successful"));
105105

106-
if (myGPS.setAutoHNRPVTcallback(&printHNRPVTdata) == true) // Enable automatic HNR PVT messages with callback to printHNRPVTdata
106+
if (myGNSS.setAutoHNRPVTcallback(&printHNRPVTdata) == true) // Enable automatic HNR PVT messages with callback to printHNRPVTdata
107107
Serial.println(F("setAutoHNRPVTcallback successful"));
108108
}
109109

110110
void loop()
111111
{
112-
myGPS.checkUblox(); // Check for the arrival of new data and process it.
113-
myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
112+
myGNSS.checkUblox(); // Check for the arrival of new data and process it.
113+
myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
114114

115115
Serial.print(".");
116116
delay(25);

examples/Callbacks/CallbackExample5_ESF/CallbackExample5_ESF.ino

+17-17
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#include <Wire.h> //Needed for I2C to GPS
2727

28-
#include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
29-
SFE_UBLOX_GPS myGPS;
28+
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
29+
SFE_UBLOX_GNSS myGNSS;
3030

3131
// Callback: printESFALGdata will be called when new ESF ALG data arrives
3232
// See u-blox_structs.h for the full definition of UBX_ESF_ALG_data_t
@@ -91,7 +91,7 @@ void printESFMEASdata(UBX_ESF_MEAS_data_t ubxDataStruct)
9191
Serial.print(num);
9292

9393
UBX_ESF_MEAS_sensorData_t sensorData;
94-
myGPS.getSensorFusionMeasurement(&sensorData, ubxDataStruct, num); // Extract the data for one sensor
94+
myGNSS.getSensorFusionMeasurement(&sensorData, ubxDataStruct, num); // Extract the data for one sensor
9595

9696
Serial.print(F(": Type: "));
9797
Serial.print(sensorData.data.bits.dataType);
@@ -117,7 +117,7 @@ void printESFSTATUSdata(UBX_ESF_STATUS_data_t ubxDataStruct)
117117
Serial.print(num);
118118

119119
UBX_ESF_STATUS_sensorStatus_t sensorStatus;
120-
myGPS.getSensorFusionStatus(&sensorStatus, ubxDataStruct, num); // Extract the data for one sensor
120+
myGNSS.getSensorFusionStatus(&sensorStatus, ubxDataStruct, num); // Extract the data for one sensor
121121

122122
Serial.print(F(": Type: "));
123123
Serial.print(sensorStatus.sensStatus1.bits.type);
@@ -140,39 +140,39 @@ void setup()
140140

141141
Wire.begin();
142142

143-
//myGPS.enableDebugging(); // Uncomment this line to enable debug messages on Serial
143+
//myGNSS.enableDebugging(); // Uncomment this line to enable debug messages on Serial
144144

145-
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
145+
if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
146146
{
147147
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
148148
while (1);
149149
}
150150

151-
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
152-
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
151+
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
152+
myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
153153

154-
myGPS.setNavigationFrequency(1); //Produce one solution per second
155-
myGPS.setHNRNavigationRate(1); //Set the High Navigation Rate to 1Hz
154+
myGNSS.setNavigationFrequency(1); //Produce one solution per second
155+
myGNSS.setHNRNavigationRate(1); //Set the High Navigation Rate to 1Hz
156156

157-
myGPS.setI2CpollingWait(50); //Allow checkUblox to poll I2C data every 50ms to keep up with the ESF MEAS messages
157+
myGNSS.setI2CpollingWait(50); //Allow checkUblox to poll I2C data every 50ms to keep up with the ESF MEAS messages
158158

159-
if (myGPS.setAutoESFALGcallback(&printESFALGdata) == true) // Enable automatic ESF ALG messages with callback to printESFALGdata
159+
if (myGNSS.setAutoESFALGcallback(&printESFALGdata) == true) // Enable automatic ESF ALG messages with callback to printESFALGdata
160160
Serial.println(F("setAutoESFALGcallback successful"));
161161

162-
if (myGPS.setAutoESFINScallback(&printESFINSdata) == true) // Enable automatic ESF INS messages with callback to printESFINSdata
162+
if (myGNSS.setAutoESFINScallback(&printESFINSdata) == true) // Enable automatic ESF INS messages with callback to printESFINSdata
163163
Serial.println(F("setAutoESFINScallback successful"));
164164

165-
if (myGPS.setAutoESFMEAScallback(&printESFMEASdata) == true) // Enable automatic ESF MEAS messages with callback to printESFMEASdata
165+
if (myGNSS.setAutoESFMEAScallback(&printESFMEASdata) == true) // Enable automatic ESF MEAS messages with callback to printESFMEASdata
166166
Serial.println(F("setAutoESFMEAScallback successful"));
167167

168-
if (myGPS.setAutoESFSTATUScallback(&printESFSTATUSdata) == true) // Enable automatic ESF STATUS messages with callback to printESFSTATUSdata
168+
if (myGNSS.setAutoESFSTATUScallback(&printESFSTATUSdata) == true) // Enable automatic ESF STATUS messages with callback to printESFSTATUSdata
169169
Serial.println(F("setAutoESFSTATUScallback successful"));
170170
}
171171

172172
void loop()
173173
{
174-
myGPS.checkUblox(); // Check for the arrival of new data and process it.
175-
myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
174+
myGNSS.checkUblox(); // Check for the arrival of new data and process it.
175+
myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed.
176176

177177
Serial.print(".");
178178
delay(25);

examples/Data_Logging/DataLoggingExample1_NAV_PVT/DataLoggingExample1_NAV_PVT.ino

+15-15
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
#include <SD.h>
4747
#include <Wire.h> //Needed for I2C to GNSS
4848

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;
5151

5252
File myFile; //File that all GNSS data is written to
5353

@@ -150,46 +150,46 @@ void setup()
150150
while (1);
151151
}
152152

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
154154

155155
// NAV PVT messages are 100 bytes long.
156156
// In this example, the data will arrive no faster than one message per second.
157157
// So, setting the file buffer size to 301 bytes should be more than adequate.
158158
// 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
160160

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
162162
{
163163
Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing..."));
164164
while (1);
165165
}
166166

167167
// Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate
168168
// (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);
170170

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
173173

174-
myGPS.setNavigationFrequency(1); //Produce one navigation solution per second
174+
myGNSS.setNavigationFrequency(1); //Produce one navigation solution per second
175175

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
177177

178-
myGPS.logNAVPVT(); // Enable NAV PVT data logging
178+
myGNSS.logNAVPVT(); // Enable NAV PVT data logging
179179

180180
Serial.println(F("Press any key to stop logging."));
181181
}
182182

183183
void loop()
184184
{
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.
187187

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
189189
{
190190
uint8_t myBuffer[packetLength]; // Create our own buffer to hold the data while we write it to SD card
191191

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
193193

194194
myFile.write(myBuffer, packetLength); // Write exactly packetLength bytes from myBuffer to the ubxDataFile on the SD card
195195

0 commit comments

Comments
 (0)