From 627fc277001b14a7c0697806f6367efc5b94a897 Mon Sep 17 00:00:00 2001 From: PaulZC Date: Sat, 9 Jan 2021 08:18:31 +0000 Subject: [PATCH] Updating examples: change class name & update header file --- .../CallbackExample1_NAV_PVT.ino | 20 +++--- .../CallbackExample2_NAV_ODO.ino | 22 +++---- .../CallbackExample3_TIM_TM2.ino | 20 +++--- .../CallbackExample4_HNR.ino | 24 +++---- .../CallbackExample5_ESF.ino | 34 +++++----- .../DataLoggingExample1_NAV_PVT.ino | 30 ++++----- .../DataLoggingExample2_TIM_TM2.ino | 30 ++++----- ...DataLoggingExample3_RXM_SFRBX_and_RAWX.ino | 48 +++++++------- ...aLoggingExample4_RXM_without_Callbacks.ino | 44 ++++++------- .../DataLoggingExample5_Fast_RXM.ino | 66 +++++++++---------- .../Example1_calibrateSensor.ino | 22 +++---- .../Example2_getIMUData.ino | 40 +++++------ .../Example3_getSensorStatus.ino | 20 +++--- .../Example4_vehicleDynamics.ino | 30 ++++----- .../Example5_getHNRData.ino | 44 ++++++------- .../Example6_getAutoHNRData.ino | 50 +++++++------- .../Example10_AltitudeMSL.ino | 12 ++-- .../Example1_FactoryDefaultviaI2C.ino | 10 +-- .../Example2_FactoryDefaultsviaSerial.ino | 28 ++++---- .../Example12_UseUart/Example12_UseUart.ino | 24 +++---- .../Example1_AutoPVT/Example1_AutoPVT.ino | 48 +++++++------- .../Example2_AutoPVT_ExplicitUpdate.ino | 24 +++---- .../Example3_AutoPVTviaUart.ino | 22 +++---- .../Example4_AssumeAutoPVTviaUart.ino | 16 ++--- .../Example14_DebugOutput.ino | 36 +++++----- .../Example15_GetDateTime.ino | 32 ++++----- .../Example16_Nanosecond_MaxOutput.ino | 40 +++++------ .../Example16_PartialSecond_MaxOutput.ino | 40 +++++------ .../Example17_Geofence/Example17_Geofence.ino | 26 ++++---- .../Example18_PowerSaveMode.ino | 26 ++++---- .../Example19_DynamicModel.ino | 20 +++--- .../Example1_BasicNMEARead.ino | 8 +-- .../Example20_SendCustomCommand.ino | 24 +++---- .../Example21_ModuleInfo.ino | 30 ++++----- .../Example22_PowerOff/Example22_PowerOff.ino | 10 +-- .../Example2_NMEAParsing.ino | 8 +-- .../Example3_GetPosition.ino | 16 ++--- .../Example4_FixType/Example4_FixType.ino | 14 ++-- .../Example5_SpeedHeadingPrecision.ino | 14 ++-- .../Example6_EnableNMEASentences.ino | 26 ++++---- .../Example7_OutputRate.ino | 14 ++-- .../Example8_GetProtocolVersion.ino | 8 +-- .../Example8_GetProtocolVersion_Serial.ino | 10 +-- .../Example9_ChangeI2CAddress.ino | 12 ++-- .../Example1_EnableRTCM.ino | 18 ++--- .../Example2_StartRTCMBase.ino | 38 +++++------ .../Example3_BaseWithLCD.ino | 40 +++++------ ...10_GetHighPrecisionPositionAndAccuracy.ino | 32 ++++----- ...11_GetHighPrecisionPositionUsingDouble.ino | 32 ++++----- .../Example12_setStaticPosition.ino | 18 ++--- .../Example13_autoHPPOSLLH.ino | 50 +++++++------- .../Example13_autoHPPOSLLH_with_Callback.ino | 26 ++++---- .../Example14_NTRIPServer.ino | 46 ++++++------- .../Example1_GetPositionAccuracy.ino | 16 ++--- .../Example2_ValConfigurationMethod.ino | 8 +-- .../Example3_StartRTCMBase.ino | 58 ++++++++-------- .../Example4_BaseWithLCD.ino | 52 +++++++-------- ...xample5_RelativePositioningInformation.ino | 56 ++++++++-------- .../Example6_GetVal/Example6_GetVal.ino | 10 +-- .../Example7_SetVal/Example7_SetVal.ino | 18 ++--- .../Example8_GetSetPortSettings.ino | 20 +++--- .../Example9_multiSetVal.ino | 32 ++++----- 62 files changed, 856 insertions(+), 856 deletions(-) diff --git a/examples/Callbacks/CallbackExample1_NAV_PVT/CallbackExample1_NAV_PVT.ino b/examples/Callbacks/CallbackExample1_NAV_PVT/CallbackExample1_NAV_PVT.ino index 44633df..767f731 100644 --- a/examples/Callbacks/CallbackExample1_NAV_PVT/CallbackExample1_NAV_PVT.ino +++ b/examples/Callbacks/CallbackExample1_NAV_PVT/CallbackExample1_NAV_PVT.ino @@ -23,8 +23,8 @@ #include //Needed for I2C to GPS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; // Callback: printPVTdata will be called when new NAV PVT data arrives // See u-blox_structs.h for the full definition of UBX_NAV_PVT_data_t @@ -78,26 +78,26 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - myGPS.setNavigationFrequency(2); //Produce two solutions per second + myGNSS.setNavigationFrequency(2); //Produce two solutions per second - myGPS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata + myGNSS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata } void loop() { - myGPS.checkUblox(); // Check for the arrival of new data and process it. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. Serial.print("."); delay(50); diff --git a/examples/Callbacks/CallbackExample2_NAV_ODO/CallbackExample2_NAV_ODO.ino b/examples/Callbacks/CallbackExample2_NAV_ODO/CallbackExample2_NAV_ODO.ino index 9be4072..707f7f1 100644 --- a/examples/Callbacks/CallbackExample2_NAV_ODO/CallbackExample2_NAV_ODO.ino +++ b/examples/Callbacks/CallbackExample2_NAV_ODO/CallbackExample2_NAV_ODO.ino @@ -23,8 +23,8 @@ #include //Needed for I2C to GPS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; // Callback: printODOdata will be called when new NAV ODO data arrives // See u-blox_structs.h for the full definition of UBX_NAV_ODO_data_t @@ -61,28 +61,28 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - myGPS.setNavigationFrequency(1); //Produce one solution per second + myGNSS.setNavigationFrequency(1); //Produce one solution per second - //myGPS.resetOdometer(); //Uncomment this line to reset the odometer + //myGNSS.resetOdometer(); //Uncomment this line to reset the odometer - myGPS.setAutoNAVODOcallback(&printODOdata); // Enable automatic NAV ODO messages with callback to printODOdata + myGNSS.setAutoNAVODOcallback(&printODOdata); // Enable automatic NAV ODO messages with callback to printODOdata } void loop() { - myGPS.checkUblox(); // Check for the arrival of new data and process it. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. Serial.print("."); delay(50); diff --git a/examples/Callbacks/CallbackExample3_TIM_TM2/CallbackExample3_TIM_TM2.ino b/examples/Callbacks/CallbackExample3_TIM_TM2/CallbackExample3_TIM_TM2.ino index 4278a7e..d119087 100644 --- a/examples/Callbacks/CallbackExample3_TIM_TM2/CallbackExample3_TIM_TM2.ino +++ b/examples/Callbacks/CallbackExample3_TIM_TM2/CallbackExample3_TIM_TM2.ino @@ -36,8 +36,8 @@ #include //Needed for I2C to GPS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; int dotsPrinted = 0; // Print dots in rows of 50 while waiting for a TIM TM2 message @@ -84,26 +84,26 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - myGPS.setNavigationFrequency(1); //Produce one solution per second + myGNSS.setNavigationFrequency(1); //Produce one solution per second - myGPS.setAutoTIMTM2callback(&printTIMTM2data); // Enable automatic TIM TM2 messages with callback to printTIMTM2data + myGNSS.setAutoTIMTM2callback(&printTIMTM2data); // Enable automatic TIM TM2 messages with callback to printTIMTM2data } void loop() { - myGPS.checkUblox(); // Check for the arrival of new data and process it. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. Serial.print("."); delay(50); diff --git a/examples/Callbacks/CallbackExample4_HNR/CallbackExample4_HNR.ino b/examples/Callbacks/CallbackExample4_HNR/CallbackExample4_HNR.ino index 668686e..284cf25 100644 --- a/examples/Callbacks/CallbackExample4_HNR/CallbackExample4_HNR.ino +++ b/examples/Callbacks/CallbackExample4_HNR/CallbackExample4_HNR.ino @@ -28,8 +28,8 @@ #include //Needed for I2C to GPS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; // Callback: printHNRATTdata will be called when new HNR ATT data arrives // See u-blox_structs.h for the full definition of UBX_HNR_ATT_data_t @@ -81,36 +81,36 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages on Serial - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - if (myGPS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz + if (myGNSS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz Serial.println(F("setHNRNavigationRate was successful")); else Serial.println(F("setHNRNavigationRate was NOT successful")); - if (myGPS.setAutoHNRATTcallback(&printHNRATTdata) == true) // Enable automatic HNR ATT messages with callback to printHNRATTdata + if (myGNSS.setAutoHNRATTcallback(&printHNRATTdata) == true) // Enable automatic HNR ATT messages with callback to printHNRATTdata Serial.println(F("setAutoHNRATTcallback successful")); - if (myGPS.setAutoHNRINScallback(&printHNRINSdata) == true) // Enable automatic HNR INS messages with callback to printHNRINSdata + if (myGNSS.setAutoHNRINScallback(&printHNRINSdata) == true) // Enable automatic HNR INS messages with callback to printHNRINSdata Serial.println(F("setAutoHNRINScallback successful")); - if (myGPS.setAutoHNRPVTcallback(&printHNRPVTdata) == true) // Enable automatic HNR PVT messages with callback to printHNRPVTdata + if (myGNSS.setAutoHNRPVTcallback(&printHNRPVTdata) == true) // Enable automatic HNR PVT messages with callback to printHNRPVTdata Serial.println(F("setAutoHNRPVTcallback successful")); } void loop() { - myGPS.checkUblox(); // Check for the arrival of new data and process it. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. Serial.print("."); delay(25); diff --git a/examples/Callbacks/CallbackExample5_ESF/CallbackExample5_ESF.ino b/examples/Callbacks/CallbackExample5_ESF/CallbackExample5_ESF.ino index 1341ab5..0d09322 100644 --- a/examples/Callbacks/CallbackExample5_ESF/CallbackExample5_ESF.ino +++ b/examples/Callbacks/CallbackExample5_ESF/CallbackExample5_ESF.ino @@ -25,8 +25,8 @@ #include //Needed for I2C to GPS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; // Callback: printESFALGdata will be called when new ESF ALG data arrives // 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) Serial.print(num); UBX_ESF_MEAS_sensorData_t sensorData; - myGPS.getSensorFusionMeasurement(&sensorData, ubxDataStruct, num); // Extract the data for one sensor + myGNSS.getSensorFusionMeasurement(&sensorData, ubxDataStruct, num); // Extract the data for one sensor Serial.print(F(": Type: ")); Serial.print(sensorData.data.bits.dataType); @@ -117,7 +117,7 @@ void printESFSTATUSdata(UBX_ESF_STATUS_data_t ubxDataStruct) Serial.print(num); UBX_ESF_STATUS_sensorStatus_t sensorStatus; - myGPS.getSensorFusionStatus(&sensorStatus, ubxDataStruct, num); // Extract the data for one sensor + myGNSS.getSensorFusionStatus(&sensorStatus, ubxDataStruct, num); // Extract the data for one sensor Serial.print(F(": Type: ")); Serial.print(sensorStatus.sensStatus1.bits.type); @@ -140,39 +140,39 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages on Serial - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - myGPS.setNavigationFrequency(1); //Produce one solution per second - myGPS.setHNRNavigationRate(1); //Set the High Navigation Rate to 1Hz + myGNSS.setNavigationFrequency(1); //Produce one solution per second + myGNSS.setHNRNavigationRate(1); //Set the High Navigation Rate to 1Hz - myGPS.setI2CpollingWait(50); //Allow checkUblox to poll I2C data every 50ms to keep up with the ESF MEAS messages + myGNSS.setI2CpollingWait(50); //Allow checkUblox to poll I2C data every 50ms to keep up with the ESF MEAS messages - if (myGPS.setAutoESFALGcallback(&printESFALGdata) == true) // Enable automatic ESF ALG messages with callback to printESFALGdata + if (myGNSS.setAutoESFALGcallback(&printESFALGdata) == true) // Enable automatic ESF ALG messages with callback to printESFALGdata Serial.println(F("setAutoESFALGcallback successful")); - if (myGPS.setAutoESFINScallback(&printESFINSdata) == true) // Enable automatic ESF INS messages with callback to printESFINSdata + if (myGNSS.setAutoESFINScallback(&printESFINSdata) == true) // Enable automatic ESF INS messages with callback to printESFINSdata Serial.println(F("setAutoESFINScallback successful")); - if (myGPS.setAutoESFMEAScallback(&printESFMEASdata) == true) // Enable automatic ESF MEAS messages with callback to printESFMEASdata + if (myGNSS.setAutoESFMEAScallback(&printESFMEASdata) == true) // Enable automatic ESF MEAS messages with callback to printESFMEASdata Serial.println(F("setAutoESFMEAScallback successful")); - if (myGPS.setAutoESFSTATUScallback(&printESFSTATUSdata) == true) // Enable automatic ESF STATUS messages with callback to printESFSTATUSdata + if (myGNSS.setAutoESFSTATUScallback(&printESFSTATUSdata) == true) // Enable automatic ESF STATUS messages with callback to printESFSTATUSdata Serial.println(F("setAutoESFSTATUScallback successful")); } void loop() { - myGPS.checkUblox(); // Check for the arrival of new data and process it. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. Serial.print("."); delay(25); diff --git a/examples/Data_Logging/DataLoggingExample1_NAV_PVT/DataLoggingExample1_NAV_PVT.ino b/examples/Data_Logging/DataLoggingExample1_NAV_PVT/DataLoggingExample1_NAV_PVT.ino index 0b656cf..19b20d5 100644 --- a/examples/Data_Logging/DataLoggingExample1_NAV_PVT/DataLoggingExample1_NAV_PVT.ino +++ b/examples/Data_Logging/DataLoggingExample1_NAV_PVT/DataLoggingExample1_NAV_PVT.ino @@ -46,8 +46,8 @@ #include #include //Needed for I2C to GNSS -#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; File myFile; //File that all GNSS data is written to @@ -150,15 +150,15 @@ void setup() while (1); } - //myGPS.enableDebugging(); // Uncomment this line to enable helpful GNSS debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable helpful GNSS debug messages on Serial // NAV PVT messages are 100 bytes long. // In this example, the data will arrive no faster than one message per second. // So, setting the file buffer size to 301 bytes should be more than adequate. // I.e. room for three messages plus an empty tail byte. - myGPS.setFileBufferSize(301); // setFileBufferSize must be called _before_ .begin + myGNSS.setFileBufferSize(301); // setFileBufferSize must be called _before_ .begin - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing...")); while (1); @@ -166,30 +166,30 @@ void setup() // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate // (This will also disable any "auto" messages that were enabled and saved by other examples and reduce the load on the I2C bus) - //myGPS.factoryDefault(); delay(5000); + //myGNSS.factoryDefault(); delay(5000); - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - myGPS.setNavigationFrequency(1); //Produce one navigation solution per second + myGNSS.setNavigationFrequency(1); //Produce one navigation solution per second - myGPS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata + myGNSS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata - myGPS.logNAVPVT(); // Enable NAV PVT data logging + myGNSS.logNAVPVT(); // Enable NAV PVT data logging Serial.println(F("Press any key to stop logging.")); } void loop() { - myGPS.checkUblox(); // Check for the arrival of new data and process it. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. - if (myGPS.fileBufferAvailable() >= packetLength) // Check to see if a new packetLength-byte NAV PVT message has been stored + if (myGNSS.fileBufferAvailable() >= packetLength) // Check to see if a new packetLength-byte NAV PVT message has been stored { uint8_t myBuffer[packetLength]; // Create our own buffer to hold the data while we write it to SD card - myGPS.extractFileBufferData((uint8_t *)&myBuffer, packetLength); // Extract exactly packetLength bytes from the UBX file buffer and put them into myBuffer + myGNSS.extractFileBufferData((uint8_t *)&myBuffer, packetLength); // Extract exactly packetLength bytes from the UBX file buffer and put them into myBuffer myFile.write(myBuffer, packetLength); // Write exactly packetLength bytes from myBuffer to the ubxDataFile on the SD card diff --git a/examples/Data_Logging/DataLoggingExample2_TIM_TM2/DataLoggingExample2_TIM_TM2.ino b/examples/Data_Logging/DataLoggingExample2_TIM_TM2/DataLoggingExample2_TIM_TM2.ino index 2bd8c02..361e960 100644 --- a/examples/Data_Logging/DataLoggingExample2_TIM_TM2/DataLoggingExample2_TIM_TM2.ino +++ b/examples/Data_Logging/DataLoggingExample2_TIM_TM2/DataLoggingExample2_TIM_TM2.ino @@ -59,8 +59,8 @@ #include #include //Needed for I2C to GNSS -#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; File myFile; //File that all GNSS data is written to @@ -156,15 +156,15 @@ void setup() while (1); } - //myGPS.enableDebugging(); // Uncomment this line to enable helpful GNSS debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable helpful GNSS debug messages on Serial // TIM TM2 messages are 36 bytes long. // In this example, the data will arrive no faster than one message per second. // So, setting the file buffer size to 109 bytes should be more than adequate. // I.e. room for three messages plus an empty tail byte. - myGPS.setFileBufferSize(109); // setFileBufferSize must be called _before_ .begin + myGNSS.setFileBufferSize(109); // setFileBufferSize must be called _before_ .begin - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing...")); while (1); @@ -172,30 +172,30 @@ void setup() // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate // (This will also disable any "auto" messages that were enabled and saved by other examples and reduce the load on the I2C bus) - //myGPS.factoryDefault(); delay(5000); + //myGNSS.factoryDefault(); delay(5000); - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - myGPS.setNavigationFrequency(1); //Produce one navigation solution per second + myGNSS.setNavigationFrequency(1); //Produce one navigation solution per second - myGPS.setAutoTIMTM2callback(&printTIMTM2data); // Enable automatic TIM TM2 messages with callback to printTIMTM2data + myGNSS.setAutoTIMTM2callback(&printTIMTM2data); // Enable automatic TIM TM2 messages with callback to printTIMTM2data - myGPS.logTIMTM2(); // Enable TIM TM2 data logging + myGNSS.logTIMTM2(); // Enable TIM TM2 data logging Serial.println(F("Press any key to stop logging.")); } void loop() { - myGPS.checkUblox(); // Check for the arrival of new data and process it. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. - if (myGPS.fileBufferAvailable() >= packetLength) // Check to see if a new packetLength-byte TIM TM2 message has been stored + if (myGNSS.fileBufferAvailable() >= packetLength) // Check to see if a new packetLength-byte TIM TM2 message has been stored { uint8_t myBuffer[packetLength]; // Create our own buffer to hold the data while we write it to SD card - myGPS.extractFileBufferData((uint8_t *)&myBuffer, packetLength); // Extract exactly packetLength bytes from the UBX file buffer and put them into myBuffer + myGNSS.extractFileBufferData((uint8_t *)&myBuffer, packetLength); // Extract exactly packetLength bytes from the UBX file buffer and put them into myBuffer myFile.write(myBuffer, packetLength); // Write exactly packetLength bytes from myBuffer to the ubxDataFile on the SD card diff --git a/examples/Data_Logging/DataLoggingExample3_RXM_SFRBX_and_RAWX/DataLoggingExample3_RXM_SFRBX_and_RAWX.ino b/examples/Data_Logging/DataLoggingExample3_RXM_SFRBX_and_RAWX/DataLoggingExample3_RXM_SFRBX_and_RAWX.ino index 4c8dcf3..71aeadc 100644 --- a/examples/Data_Logging/DataLoggingExample3_RXM_SFRBX_and_RAWX/DataLoggingExample3_RXM_SFRBX_and_RAWX.ino +++ b/examples/Data_Logging/DataLoggingExample3_RXM_SFRBX_and_RAWX/DataLoggingExample3_RXM_SFRBX_and_RAWX.ino @@ -52,8 +52,8 @@ #include #include //Needed for I2C to GNSS -#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; File myFile; //File that all GNSS data is written to @@ -149,18 +149,18 @@ void setup() while (1); } - //myGPS.enableDebugging(); // Uncomment this line to enable lots of helpful GNSS debug messages on Serial - //myGPS.enableDebugging(Serial, true); // Or, uncomment this line to enable only the important GNSS debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable lots of helpful GNSS debug messages on Serial + //myGNSS.enableDebugging(Serial, true); // Or, uncomment this line to enable only the important GNSS debug messages on Serial - myGPS.disableUBX7Fcheck(); // RAWX data can legitimately contain 0x7F, so we need to disable the "7F" check in checkUbloxI2C + myGNSS.disableUBX7Fcheck(); // RAWX data can legitimately contain 0x7F, so we need to disable the "7F" check in checkUbloxI2C // RAWX messages can be over 2KBytes in size, so we need to make sure we allocate enough RAM to hold all the data. // SD cards can occasionally 'hiccup' and a write takes much longer than usual. The buffer needs to be big enough // to hold the backlog of data if/when this happens. // getMaxFileBufferAvail will tell us the maximum number of bytes which the file buffer has contained. - myGPS.setFileBufferSize(fileBufferSize); // setFileBufferSize must be called _before_ .begin + myGNSS.setFileBufferSize(fileBufferSize); // setFileBufferSize must be called _before_ .begin - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing...")); while (1); @@ -168,20 +168,20 @@ void setup() // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate // (This will also disable any "auto" messages that were enabled and saved by other examples and reduce the load on the I2C bus) - //myGPS.factoryDefault(); delay(5000); + //myGNSS.factoryDefault(); delay(5000); - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - myGPS.setNavigationFrequency(1); //Produce one navigation solution per second (that's plenty for Precise Point Positioning) + myGNSS.setNavigationFrequency(1); //Produce one navigation solution per second (that's plenty for Precise Point Positioning) - myGPS.setAutoRXMSFRBXcallback(&newSFRBX); // Enable automatic RXM SFRBX messages with callback to newSFRBX + myGNSS.setAutoRXMSFRBXcallback(&newSFRBX); // Enable automatic RXM SFRBX messages with callback to newSFRBX - myGPS.logRXMSFRBX(); // Enable RXM SFRBX data logging + myGNSS.logRXMSFRBX(); // Enable RXM SFRBX data logging - myGPS.setAutoRXMRAWXcallback(&newRAWX); // Enable automatic RXM RAWX messages with callback to newRAWX + myGNSS.setAutoRXMRAWXcallback(&newRAWX); // Enable automatic RXM RAWX messages with callback to newRAWX - myGPS.logRXMRAWX(); // Enable RXM RAWX data logging + myGNSS.logRXMRAWX(); // Enable RXM RAWX data logging Serial.println(F("Press any key to stop logging.")); @@ -192,24 +192,24 @@ void loop() { // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - myGPS.checkUblox(); // Check for the arrival of new data and process it. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - while (myGPS.fileBufferAvailable() >= sdWriteSize) // Check to see if we have at least sdWriteSize waiting in the buffer + while (myGNSS.fileBufferAvailable() >= sdWriteSize) // Check to see if we have at least sdWriteSize waiting in the buffer { digitalWrite(LED_BUILTIN, HIGH); // Flash LED_BUILTIN each time we write to the SD card uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card - myGPS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer + myGNSS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer myFile.write(myBuffer, sdWriteSize); // Write exactly sdWriteSize bytes from myBuffer to the ubxDataFile on the SD card // In case the SD writing is slow or there is a lot of data to write, keep checking for the arrival of new data - myGPS.checkUblox(); // Check for the arrival of new data and process it. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. digitalWrite(LED_BUILTIN, LOW); // Turn LED_BUILTIN off again } @@ -223,7 +223,7 @@ void loop() Serial.print(F(" RAWX: ")); Serial.println(numRAWX); - uint16_t maxBufferBytes = myGPS.getMaxFileBufferAvail(); // Get how full the file buffer has been (not how full it is now) + uint16_t maxBufferBytes = myGNSS.getMaxFileBufferAvail(); // Get how full the file buffer has been (not how full it is now) //Serial.print(F("The maximum number of bytes which the file buffer has contained is: ")); // It is a fun thing to watch how full the buffer gets //Serial.println(maxBufferBytes); @@ -240,7 +240,7 @@ void loop() if (Serial.available()) // Check if the user wants to stop logging { - uint16_t remainingBytes = myGPS.fileBufferAvailable(); // Check if there are any bytes remaining in the file buffer + uint16_t remainingBytes = myGNSS.fileBufferAvailable(); // Check if there are any bytes remaining in the file buffer while (remainingBytes > 0) // While there is still data in the file buffer { @@ -254,7 +254,7 @@ void loop() bytesToWrite = sdWriteSize; } - myGPS.extractFileBufferData((uint8_t *)&myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer + myGNSS.extractFileBufferData((uint8_t *)&myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer myFile.write(myBuffer, bytesToWrite); // Write bytesToWrite bytes from myBuffer to the ubxDataFile on the SD card diff --git a/examples/Data_Logging/DataLoggingExample4_RXM_without_Callbacks/DataLoggingExample4_RXM_without_Callbacks.ino b/examples/Data_Logging/DataLoggingExample4_RXM_without_Callbacks/DataLoggingExample4_RXM_without_Callbacks.ino index 477915e..3b5576a 100644 --- a/examples/Data_Logging/DataLoggingExample4_RXM_without_Callbacks/DataLoggingExample4_RXM_without_Callbacks.ino +++ b/examples/Data_Logging/DataLoggingExample4_RXM_without_Callbacks/DataLoggingExample4_RXM_without_Callbacks.ino @@ -53,8 +53,8 @@ #include #include //Needed for I2C to GNSS -#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; File myFile; //File that all GNSS data is written to @@ -120,18 +120,18 @@ void setup() while (1); } - //myGPS.enableDebugging(); // Uncomment this line to enable lots of helpful GNSS debug messages on Serial - //myGPS.enableDebugging(Serial, true); // Or, uncomment this line to enable only the important GNSS debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable lots of helpful GNSS debug messages on Serial + //myGNSS.enableDebugging(Serial, true); // Or, uncomment this line to enable only the important GNSS debug messages on Serial - myGPS.disableUBX7Fcheck(); // RAWX data can legitimately contain 0x7F, so we need to disable the "7F" check in checkUbloxI2C + myGNSS.disableUBX7Fcheck(); // RAWX data can legitimately contain 0x7F, so we need to disable the "7F" check in checkUbloxI2C // RAWX messages can be over 2KBytes in size, so we need to make sure we allocate enough RAM to hold all the data. // SD cards can occasionally 'hiccup' and a write takes much longer than usual. The buffer needs to be big enough // to hold the backlog of data if/when this happens. // getMaxFileBufferAvail will tell us the maximum number of bytes which the file buffer has contained. - myGPS.setFileBufferSize(fileBufferSize); // setFileBufferSize must be called _before_ .begin + myGNSS.setFileBufferSize(fileBufferSize); // setFileBufferSize must be called _before_ .begin - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing...")); while (1); @@ -139,20 +139,20 @@ void setup() // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate // (This will also disable any "auto" messages that were enabled and saved by other examples and reduce the load on the I2C bus) - //myGPS.factoryDefault(); delay(5000); + //myGNSS.factoryDefault(); delay(5000); - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - myGPS.setNavigationFrequency(1); //Produce one navigation solution per second (that's plenty for Precise Point Positioning) + myGNSS.setNavigationFrequency(1); //Produce one navigation solution per second (that's plenty for Precise Point Positioning) - myGPS.setAutoRXMSFRBX(true, false); // Enable automatic RXM SFRBX messages: without callback; without implicit update + myGNSS.setAutoRXMSFRBX(true, false); // Enable automatic RXM SFRBX messages: without callback; without implicit update - myGPS.logRXMSFRBX(); // Enable RXM SFRBX data logging + myGNSS.logRXMSFRBX(); // Enable RXM SFRBX data logging - myGPS.setAutoRXMRAWX(true, false); // Enable automatic RXM RAWX messages: without callback; without implicit update + myGNSS.setAutoRXMRAWX(true, false); // Enable automatic RXM RAWX messages: without callback; without implicit update - myGPS.logRXMRAWX(); // Enable RXM RAWX data logging + myGNSS.logRXMRAWX(); // Enable RXM RAWX data logging Serial.println(F("Press any key to stop logging.")); @@ -163,24 +163,24 @@ void loop() { // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - myGPS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - while (myGPS.fileBufferAvailable() >= sdWriteSize) // Check to see if we have at least sdWriteSize waiting in the buffer + while (myGNSS.fileBufferAvailable() >= sdWriteSize) // Check to see if we have at least sdWriteSize waiting in the buffer { digitalWrite(LED_BUILTIN, HIGH); // Flash LED_BUILTIN each time we write to the SD card uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card - myGPS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer + myGNSS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer myFile.write(myBuffer, sdWriteSize); // Write exactly sdWriteSize bytes from myBuffer to the ubxDataFile on the SD card bytesWritten += sdWriteSize; // Update bytesWritten // In case the SD writing is slow or there is a lot of data to write, keep checking for the arrival of new data - myGPS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. digitalWrite(LED_BUILTIN, LOW); // Turn LED_BUILTIN off again } @@ -192,7 +192,7 @@ void loop() Serial.print(F("The number of bytes written to SD card is ")); // Print how many bytes have been written to SD card Serial.println(bytesWritten); - uint16_t maxBufferBytes = myGPS.getMaxFileBufferAvail(); // Get how full the file buffer has been (not how full it is now) + uint16_t maxBufferBytes = myGNSS.getMaxFileBufferAvail(); // Get how full the file buffer has been (not how full it is now) //Serial.print(F("The maximum number of bytes which the file buffer has contained is: ")); // It is a fun thing to watch how full the buffer gets //Serial.println(maxBufferBytes); @@ -209,7 +209,7 @@ void loop() if (Serial.available()) // Check if the user wants to stop logging { - uint16_t remainingBytes = myGPS.fileBufferAvailable(); // Check if there are any bytes remaining in the file buffer + uint16_t remainingBytes = myGNSS.fileBufferAvailable(); // Check if there are any bytes remaining in the file buffer while (remainingBytes > 0) // While there is still data in the file buffer { @@ -223,7 +223,7 @@ void loop() bytesToWrite = sdWriteSize; } - myGPS.extractFileBufferData((uint8_t *)&myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer + myGNSS.extractFileBufferData((uint8_t *)&myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer myFile.write(myBuffer, bytesToWrite); // Write bytesToWrite bytes from myBuffer to the ubxDataFile on the SD card diff --git a/examples/Data_Logging/DataLoggingExample5_Fast_RXM/DataLoggingExample5_Fast_RXM.ino b/examples/Data_Logging/DataLoggingExample5_Fast_RXM/DataLoggingExample5_Fast_RXM.ino index 3ce095c..722d4a5 100644 --- a/examples/Data_Logging/DataLoggingExample5_Fast_RXM/DataLoggingExample5_Fast_RXM.ino +++ b/examples/Data_Logging/DataLoggingExample5_Fast_RXM/DataLoggingExample5_Fast_RXM.ino @@ -53,8 +53,8 @@ #include #include //Needed for I2C to GNSS -#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; File myFile; //File that all GNSS data is written to @@ -120,18 +120,18 @@ void setup() while (1); } - //myGPS.enableDebugging(); // Uncomment this line to enable lots of helpful GNSS debug messages on Serial - //myGPS.enableDebugging(Serial, true); // Or, uncomment this line to enable only the important GNSS debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable lots of helpful GNSS debug messages on Serial + //myGNSS.enableDebugging(Serial, true); // Or, uncomment this line to enable only the important GNSS debug messages on Serial - myGPS.disableUBX7Fcheck(); // RAWX data can legitimately contain 0x7F, so we need to disable the "7F" check in checkUbloxI2C + myGNSS.disableUBX7Fcheck(); // RAWX data can legitimately contain 0x7F, so we need to disable the "7F" check in checkUbloxI2C // RAWX messages can be over 2KBytes in size, so we need to make sure we allocate enough RAM to hold all the data. // SD cards can occasionally 'hiccup' and a write takes much longer than usual. The buffer needs to be big enough // to hold the backlog of data if/when this happens. // getMaxFileBufferAvail will tell us the maximum number of bytes which the file buffer has contained. - myGPS.setFileBufferSize(fileBufferSize); // setFileBufferSize must be called _before_ .begin + myGNSS.setFileBufferSize(fileBufferSize); // setFileBufferSize must be called _before_ .begin - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing...")); while (1); @@ -139,35 +139,35 @@ void setup() // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate // (This will also disable any "auto" messages that were enabled and saved by other examples and reduce the load on the I2C bus) - //myGPS.factoryDefault(); delay(5000); + //myGNSS.factoryDefault(); delay(5000); - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR // Modules like the ZED-F9P can produce RAW navigation data at rates of up to 25Hz but not while using all of the GNSS constellations. // Please consult the data sheet for the Performance figures for your module. // In this example we make sure GPS is enabled and then disable Galileo, GLONASS, BeiDou, SBAS and QZSS to achieve 25Hz. - myGPS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GPS); // Make sure GPS is enabled (we must leave at least one major GNSS enabled!) - myGPS.enableGNSS(false, SFE_UBLOX_GNSS_ID_SBAS); // Disable SBAS - myGPS.enableGNSS(false, SFE_UBLOX_GNSS_ID_GALILEO); // Disable Galileo - myGPS.enableGNSS(false, SFE_UBLOX_GNSS_ID_BEIDOU); // Disable BeiDou - myGPS.enableGNSS(false, SFE_UBLOX_GNSS_ID_IMES); // Disable IMES - myGPS.enableGNSS(false, SFE_UBLOX_GNSS_ID_QZSS); // Disable QZSS - myGPS.enableGNSS(false, SFE_UBLOX_GNSS_ID_GLONASS); // Disable GLONASS + myGNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GPS); // Make sure GPS is enabled (we must leave at least one major GNSS enabled!) + myGNSS.enableGNSS(false, SFE_UBLOX_GNSS_ID_SBAS); // Disable SBAS + myGNSS.enableGNSS(false, SFE_UBLOX_GNSS_ID_GALILEO); // Disable Galileo + myGNSS.enableGNSS(false, SFE_UBLOX_GNSS_ID_BEIDOU); // Disable BeiDou + myGNSS.enableGNSS(false, SFE_UBLOX_GNSS_ID_IMES); // Disable IMES + myGNSS.enableGNSS(false, SFE_UBLOX_GNSS_ID_QZSS); // Disable QZSS + myGNSS.enableGNSS(false, SFE_UBLOX_GNSS_ID_GLONASS); // Disable GLONASS delay(2000); // Give the module some extra time to get ready //Produce 7 navigation solutions per second. That's a lot of RAWX data - especially when using both GPS bands L1 and L2. //The SD library and card need to be able to cope with the data rate too. You may need a faster SD library to go above 7Hz. - myGPS.setNavigationFrequency(7); + myGNSS.setNavigationFrequency(7); - myGPS.setAutoRXMSFRBX(true, false); // Enable automatic RXM SFRBX messages: without callback; without implicit update + myGNSS.setAutoRXMSFRBX(true, false); // Enable automatic RXM SFRBX messages: without callback; without implicit update - myGPS.logRXMSFRBX(); // Enable RXM SFRBX data logging + myGNSS.logRXMSFRBX(); // Enable RXM SFRBX data logging - myGPS.setAutoRXMRAWX(true, false); // Enable automatic RXM RAWX messages: without callback; without implicit update + myGNSS.setAutoRXMRAWX(true, false); // Enable automatic RXM RAWX messages: without callback; without implicit update - myGPS.logRXMRAWX(); // Enable RXM RAWX data logging + myGNSS.logRXMRAWX(); // Enable RXM RAWX data logging Serial.println(F("Press any key to stop logging.")); @@ -178,24 +178,24 @@ void loop() { // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - myGPS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - while (myGPS.fileBufferAvailable() >= sdWriteSize) // Check to see if we have at least sdWriteSize waiting in the buffer + while (myGNSS.fileBufferAvailable() >= sdWriteSize) // Check to see if we have at least sdWriteSize waiting in the buffer { digitalWrite(LED_BUILTIN, HIGH); // Flash LED_BUILTIN each time we write to the SD card uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card - myGPS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer + myGNSS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer myFile.write(myBuffer, sdWriteSize); // Write exactly sdWriteSize bytes from myBuffer to the ubxDataFile on the SD card bytesWritten += sdWriteSize; // Update bytesWritten // In case the SD writing is slow or there is a lot of data to write, keep checking for the arrival of new data - myGPS.checkUblox(); // Check for the arrival of new data and process it. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. digitalWrite(LED_BUILTIN, LOW); // Turn LED_BUILTIN off again } @@ -207,7 +207,7 @@ void loop() Serial.print(F("The number of bytes written to SD card is: ")); // Print how many bytes have been written to SD card Serial.println(bytesWritten); - uint16_t maxBufferBytes = myGPS.getMaxFileBufferAvail(); // Get how full the file buffer has been (not how full it is now) + uint16_t maxBufferBytes = myGNSS.getMaxFileBufferAvail(); // Get how full the file buffer has been (not how full it is now) //Serial.print(F("The maximum number of bytes which the file buffer has contained is: ")); // It is a fun thing to watch how full the buffer gets //Serial.println(maxBufferBytes); @@ -224,13 +224,13 @@ void loop() if (Serial.available()) // Check if the user wants to stop logging { - myGPS.setAutoRXMSFRBX(false, false); // Disable the automatic RXM SFRBX messages - myGPS.setAutoRXMRAWX(false, false); // Disable the automatic RXM RAWX messages + myGNSS.setAutoRXMSFRBX(false, false); // Disable the automatic RXM SFRBX messages + myGNSS.setAutoRXMRAWX(false, false); // Disable the automatic RXM RAWX messages delay(1000); // Allow time for any remaining messages to arrive - myGPS.checkUblox(); // Process any remaining data + myGNSS.checkUblox(); // Process any remaining data - uint16_t remainingBytes = myGPS.fileBufferAvailable(); // Check if there are any bytes remaining in the file buffer + uint16_t remainingBytes = myGNSS.fileBufferAvailable(); // Check if there are any bytes remaining in the file buffer while (remainingBytes > 0) // While there is still data in the file buffer { @@ -244,7 +244,7 @@ void loop() bytesToWrite = sdWriteSize; } - myGPS.extractFileBufferData((uint8_t *)&myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer + myGNSS.extractFileBufferData((uint8_t *)&myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer myFile.write(myBuffer, bytesToWrite); // Write bytesToWrite bytes from myBuffer to the ubxDataFile on the SD card @@ -258,7 +258,7 @@ void loop() Serial.print(F("The total number of bytes written to SD card is: ")); // Print how many bytes have been written to SD card Serial.println(bytesWritten); - uint16_t maxBufferBytes = myGPS.getMaxFileBufferAvail(); // Show how full the file buffer has been (not how full it is now) + uint16_t maxBufferBytes = myGNSS.getMaxFileBufferAvail(); // Show how full the file buffer has been (not how full it is now) Serial.print(F("The maximum number of bytes which the file buffer has contained is: ")); Serial.println(maxBufferBytes); diff --git a/examples/Dead_Reckoning/Example1_calibrateSensor/Example1_calibrateSensor.ino b/examples/Dead_Reckoning/Example1_calibrateSensor/Example1_calibrateSensor.ino index 9ef8c03..ed85e6a 100644 --- a/examples/Dead_Reckoning/Example1_calibrateSensor/Example1_calibrateSensor.ino +++ b/examples/Dead_Reckoning/Example1_calibrateSensor/Example1_calibrateSensor.ino @@ -32,8 +32,8 @@ #include //Needed for I2C to GNSS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -43,31 +43,31 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - //myGPS.resetIMUalignment(); // Uncomment this line to reset the IMU alignment + //myGNSS.resetIMUalignment(); // Uncomment this line to reset the IMU alignment } void loop() { // ESF data is produced at the navigation rate, so by default we'll get fresh data once per second - if (myGPS.getEsfInfo()) // Poll new ESF STATUS data + if (myGNSS.getEsfInfo()) // Poll new ESF STATUS data { Serial.print(F("Fusion Mode: ")); - Serial.print(myGPS.packetUBXESFSTATUS->data.fusionMode); - if (myGPS.packetUBXESFSTATUS->data.fusionMode == 0) + Serial.print(myGNSS.packetUBXESFSTATUS->data.fusionMode); + if (myGNSS.packetUBXESFSTATUS->data.fusionMode == 0) Serial.println(F(" Sensor is initializing...")); - else if (myGPS.packetUBXESFSTATUS->data.fusionMode == 1) + else if (myGNSS.packetUBXESFSTATUS->data.fusionMode == 1) Serial.println(F(" Sensor is calibrated!")); - else if (myGPS.packetUBXESFSTATUS->data.fusionMode == 2) + else if (myGNSS.packetUBXESFSTATUS->data.fusionMode == 2) Serial.println(F(" Sensor fusion is suspended!")); - else if (myGPS.packetUBXESFSTATUS->data.fusionMode == 3) + else if (myGNSS.packetUBXESFSTATUS->data.fusionMode == 3) Serial.println(F(" Sensor fusion is disabled!")); } diff --git a/examples/Dead_Reckoning/Example2_getIMUData/Example2_getIMUData.ino b/examples/Dead_Reckoning/Example2_getIMUData/Example2_getIMUData.ino index 6ff851e..e9889d9 100644 --- a/examples/Dead_Reckoning/Example2_getIMUData/Example2_getIMUData.ino +++ b/examples/Dead_Reckoning/Example2_getIMUData/Example2_getIMUData.ino @@ -24,8 +24,8 @@ #include //Needed for I2C to GNSS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -35,20 +35,20 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - if (myGPS.getEsfInfo()){ + if (myGNSS.getEsfInfo()){ Serial.print(F("Fusion Mode: ")); - Serial.println(myGPS.packetUBXESFSTATUS->data.fusionMode); + Serial.println(myGNSS.packetUBXESFSTATUS->data.fusionMode); - if (myGPS.packetUBXESFSTATUS->data.fusionMode == 1){ + if (myGNSS.packetUBXESFSTATUS->data.fusionMode == 1){ Serial.println(F("Fusion Mode is Initialized!")); } else { @@ -61,30 +61,30 @@ void setup() void loop() { // ESF data is produced at the navigation rate, so by default we'll get fresh data once per second - if (myGPS.getEsfIns()) // Poll new ESF INS data + if (myGNSS.getEsfIns()) // Poll new ESF INS data { Serial.print(F("X Ang Rate: ")); - Serial.print(myGPS.packetUBXESFINS->data.xAngRate); + Serial.print(myGNSS.packetUBXESFINS->data.xAngRate); Serial.print(F(" Y Ang Rate: ")); - Serial.print(myGPS.packetUBXESFINS->data.yAngRate); + Serial.print(myGNSS.packetUBXESFINS->data.yAngRate); Serial.print(F(" Z Ang Rate: ")); - Serial.print(myGPS.packetUBXESFINS->data.zAngRate); + Serial.print(myGNSS.packetUBXESFINS->data.zAngRate); Serial.print(F(" X Accel: ")); - Serial.print(myGPS.packetUBXESFINS->data.xAccel); + Serial.print(myGNSS.packetUBXESFINS->data.xAccel); Serial.print(F(" Y Accel: ")); - Serial.print(myGPS.packetUBXESFINS->data.yAccel); + Serial.print(myGNSS.packetUBXESFINS->data.yAccel); Serial.print(F(" Z Accel: ")); - Serial.print(myGPS.packetUBXESFINS->data.zAccel); + Serial.print(myGNSS.packetUBXESFINS->data.zAccel); // These values also have "validity checks" that can be provided by the // ublox library by reading bitfield0 Serial.print(F(" Validity: ")); - Serial.print(myGPS.packetUBXESFINS->data.bitfield0.bits.xAngRateValid); - Serial.print(myGPS.packetUBXESFINS->data.bitfield0.bits.yAngRateValid); - Serial.print(myGPS.packetUBXESFINS->data.bitfield0.bits.zAngRateValid); - Serial.print(myGPS.packetUBXESFINS->data.bitfield0.bits.xAccelValid); - Serial.print(myGPS.packetUBXESFINS->data.bitfield0.bits.yAccelValid); - Serial.println(myGPS.packetUBXESFINS->data.bitfield0.bits.zAccelValid); + Serial.print(myGNSS.packetUBXESFINS->data.bitfield0.bits.xAngRateValid); + Serial.print(myGNSS.packetUBXESFINS->data.bitfield0.bits.yAngRateValid); + Serial.print(myGNSS.packetUBXESFINS->data.bitfield0.bits.zAngRateValid); + Serial.print(myGNSS.packetUBXESFINS->data.bitfield0.bits.xAccelValid); + Serial.print(myGNSS.packetUBXESFINS->data.bitfield0.bits.yAccelValid); + Serial.println(myGNSS.packetUBXESFINS->data.bitfield0.bits.zAccelValid); } delay(250); diff --git a/examples/Dead_Reckoning/Example3_getSensorStatus/Example3_getSensorStatus.ino b/examples/Dead_Reckoning/Example3_getSensorStatus/Example3_getSensorStatus.ino index a324394..db48d20 100644 --- a/examples/Dead_Reckoning/Example3_getSensorStatus/Example3_getSensorStatus.ino +++ b/examples/Dead_Reckoning/Example3_getSensorStatus/Example3_getSensorStatus.ino @@ -28,8 +28,8 @@ #include //Needed for I2C to GNSS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -39,23 +39,23 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) // GetEsfInfo also gets the number of sensors used by the ublox module, this // includes (in the case of the ZED-F9R) wheel tick input from the vehicle // speed sensor attached to the module. - if (myGPS.getEsfInfo()){ + if (myGNSS.getEsfInfo()){ Serial.print(F("Fusion Mode: ")); - Serial.println(myGPS.packetUBXESFSTATUS->data.fusionMode); + Serial.println(myGNSS.packetUBXESFSTATUS->data.fusionMode); - if (myGPS.packetUBXESFSTATUS->data.fusionMode == 1){ + if (myGNSS.packetUBXESFSTATUS->data.fusionMode == 1){ Serial.println(F("Fusion Mode is Initialized!")); } else { @@ -68,7 +68,7 @@ void setup() void loop() { // ESF data is produced at the navigation rate, so by default we'll get fresh data once per second - if (myGPS.getEsfInfo()) // Poll new ESF STATUS data + if (myGNSS.getEsfInfo()) // Poll new ESF STATUS data { UBX_ESF_STATUS_sensorStatus_t sensorStatus; // Create storage for the individual sensor status @@ -95,9 +95,9 @@ void loop() Serial.println(F(". e d y s s e g e e")); Serial.println(F(" ")); - for(uint8_t i = 0; i < myGPS.packetUBXESFSTATUS->data.numSens; i++) + for(uint8_t i = 0; i < myGNSS.packetUBXESFSTATUS->data.numSens; i++) { - myGPS.getSensorFusionStatus(&sensorStatus, i); // Extract the individual sensor data for this sensor + myGNSS.getSensorFusionStatus(&sensorStatus, i); // Extract the individual sensor data for this sensor Serial.print(i); Serial.print(F(" ")); // Print the sensor number diff --git a/examples/Dead_Reckoning/Example4_vehicleDynamics/Example4_vehicleDynamics.ino b/examples/Dead_Reckoning/Example4_vehicleDynamics/Example4_vehicleDynamics.ino index 41b23d7..451fec6 100644 --- a/examples/Dead_Reckoning/Example4_vehicleDynamics/Example4_vehicleDynamics.ino +++ b/examples/Dead_Reckoning/Example4_vehicleDynamics/Example4_vehicleDynamics.ino @@ -26,8 +26,8 @@ #include //Needed for I2C to GNSS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -37,20 +37,20 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - if (myGPS.getEsfInfo()){ + if (myGNSS.getEsfInfo()){ Serial.print(F("Fusion Mode: ")); - Serial.println(myGPS.packetUBXESFSTATUS->data.fusionMode); + Serial.println(myGNSS.packetUBXESFSTATUS->data.fusionMode); - if (myGPS.packetUBXESFSTATUS->data.fusionMode == 1){ + if (myGNSS.packetUBXESFSTATUS->data.fusionMode == 1){ Serial.println(F("Fusion Mode is Initialized!")); } else { @@ -63,20 +63,20 @@ void setup() void loop() { // ESF data is produced at the navigation rate, so by default we'll get fresh data once per second - if (myGPS.getEsfAlignment()) // Poll new ESF ALG data + if (myGNSS.getEsfAlignment()) // Poll new ESF ALG data { Serial.print(F("Status: ")); - Serial.print(myGPS.packetUBXESFALG->data.flags.bits.status); + Serial.print(myGNSS.packetUBXESFALG->data.flags.bits.status); Serial.print(F(" Roll: ")); - Serial.print(myGPS.getESFroll(), 2); // Use the helper function to get the roll in degrees + Serial.print(myGNSS.getESFroll(), 2); // Use the helper function to get the roll in degrees Serial.print(F(" Pitch: ")); - Serial.print(myGPS.getESFpitch(), 2); // Use the helper function to get the pitch in degrees + Serial.print(myGNSS.getESFpitch(), 2); // Use the helper function to get the pitch in degrees Serial.print(F(" Heading: ")); - Serial.print(myGPS.getESFyaw(), 2); // Use the helper function to get the yaw in degrees + Serial.print(myGNSS.getESFyaw(), 2); // Use the helper function to get the yaw in degrees Serial.print(F(" Errors: ")); - Serial.print(myGPS.packetUBXESFALG->data.error.bits.tiltAlgError); - Serial.print(myGPS.packetUBXESFALG->data.error.bits.yawAlgError); - Serial.println(myGPS.packetUBXESFALG->data.error.bits.angleError); + Serial.print(myGNSS.packetUBXESFALG->data.error.bits.tiltAlgError); + Serial.print(myGNSS.packetUBXESFALG->data.error.bits.yawAlgError); + Serial.println(myGNSS.packetUBXESFALG->data.error.bits.angleError); } delay(250); diff --git a/examples/Dead_Reckoning/Example5_getHNRData/Example5_getHNRData.ino b/examples/Dead_Reckoning/Example5_getHNRData/Example5_getHNRData.ino index 2ab7f76..a1e4930 100644 --- a/examples/Dead_Reckoning/Example5_getHNRData/Example5_getHNRData.ino +++ b/examples/Dead_Reckoning/Example5_getHNRData/Example5_getHNRData.ino @@ -29,8 +29,8 @@ #include //Needed for I2C to GPS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -40,55 +40,55 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages on Serial - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("Warning! u-blox GPS did not begin correctly.")); Serial.println(F("(This may be because the I2C port is busy with HNR messages.)")); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - if (myGPS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz + if (myGNSS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz Serial.println(F("setHNRNavigationRate was successful")); else Serial.println(F("setHNRNavigationRate was NOT successful")); - myGPS.setAutoHNRATT(false); //Make sure auto HNR attitude messages are disabled - myGPS.setAutoHNRINS(false); //Make sure auto HNR vehicle dynamics messages are disabled - myGPS.setAutoHNRPVT(false); //Make sure auto HNR PVT messages are disabled + myGNSS.setAutoHNRATT(false); //Make sure auto HNR attitude messages are disabled + myGNSS.setAutoHNRINS(false); //Make sure auto HNR vehicle dynamics messages are disabled + myGNSS.setAutoHNRPVT(false); //Make sure auto HNR PVT messages are disabled } void loop() { // Poll and print selected HNR data - if (myGPS.getHNRAtt(125) == true) // Request HNR Att data using a 125ms timeout + if (myGNSS.getHNRAtt(125) == true) // Request HNR Att data using a 125ms timeout { Serial.print(F("Roll: ")); - Serial.print(myGPS.getHNRroll(), 2); // Use the helper function to get the roll in degrees + Serial.print(myGNSS.getHNRroll(), 2); // Use the helper function to get the roll in degrees Serial.print(F(" Pitch: ")); - Serial.print(myGPS.getHNRpitch(), 2); // Use the helper function to get the pitch in degrees + Serial.print(myGNSS.getHNRpitch(), 2); // Use the helper function to get the pitch in degrees Serial.print(F(" Heading: ")); - Serial.println(myGPS.getHNRheading(), 2); // Use the helper function to get the heading in degrees + Serial.println(myGNSS.getHNRheading(), 2); // Use the helper function to get the heading in degrees } - if (myGPS.getHNRDyn(125) == true) // Request HNR Dyn data using a 125ms timeout + if (myGNSS.getHNRDyn(125) == true) // Request HNR Dyn data using a 125ms timeout { Serial.print(F("xAccel: ")); - Serial.print(myGPS.packetUBXHNRINS->data.xAccel); + Serial.print(myGNSS.packetUBXHNRINS->data.xAccel); Serial.print(F(" yAccel: ")); - Serial.print(myGPS.packetUBXHNRINS->data.yAccel); + Serial.print(myGNSS.packetUBXHNRINS->data.yAccel); Serial.print(F(" zAccel: ")); - Serial.println(myGPS.packetUBXHNRINS->data.zAccel); + Serial.println(myGNSS.packetUBXHNRINS->data.zAccel); } - if (myGPS.getHNRPVT(125) == true) // Request HNR PVT data using a 125ms timeout + if (myGNSS.getHNRPVT(125) == true) // Request HNR PVT data using a 125ms timeout { Serial.print(F("ns: ")); - Serial.print(myGPS.packetUBXHNRPVT->data.nano); + Serial.print(myGNSS.packetUBXHNRPVT->data.nano); Serial.print(F(" Lat: ")); - Serial.print(myGPS.packetUBXHNRPVT->data.lat); + Serial.print(myGNSS.packetUBXHNRPVT->data.lat); Serial.print(F(" Lon: ")); - Serial.println(myGPS.packetUBXHNRPVT->data.lon); + Serial.println(myGNSS.packetUBXHNRPVT->data.lon); } } diff --git a/examples/Dead_Reckoning/Example6_getAutoHNRData/Example6_getAutoHNRData.ino b/examples/Dead_Reckoning/Example6_getAutoHNRData/Example6_getAutoHNRData.ino index f42e466..d48787e 100644 --- a/examples/Dead_Reckoning/Example6_getAutoHNRData/Example6_getAutoHNRData.ino +++ b/examples/Dead_Reckoning/Example6_getAutoHNRData/Example6_getAutoHNRData.ino @@ -28,8 +28,8 @@ #include //Needed for I2C to GPS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; boolean usingAutoHNRAtt = false; boolean usingAutoHNRDyn = false; @@ -43,65 +43,65 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages on Serial - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("Warning! u-blox GPS did not begin correctly.")); Serial.println(F("(This may be because the I2C port is busy with HNR messages.)")); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR - if (myGPS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz + if (myGNSS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz Serial.println(F("setHNRNavigationRate was successful")); else Serial.println(F("setHNRNavigationRate was NOT successful")); - usingAutoHNRAtt = myGPS.setAutoHNRATT(true); //Attempt to enable auto HNR attitude messages + usingAutoHNRAtt = myGNSS.setAutoHNRATT(true); //Attempt to enable auto HNR attitude messages if (usingAutoHNRAtt) Serial.println(F("AutoHNRATT successful")); - usingAutoHNRDyn = myGPS.setAutoHNRINS(true); //Attempt to enable auto HNR vehicle dynamics messages + usingAutoHNRDyn = myGNSS.setAutoHNRINS(true); //Attempt to enable auto HNR vehicle dynamics messages if (usingAutoHNRDyn) Serial.println(F("AutoHNRINS successful")); - usingAutoHNRPVT = myGPS.setAutoHNRPVT(true); //Attempt to enable auto HNR PVT messages + usingAutoHNRPVT = myGNSS.setAutoHNRPVT(true); //Attempt to enable auto HNR PVT messages if (usingAutoHNRPVT) Serial.println(F("AutoHNRPVT successful")); } void loop() { - if (usingAutoHNRAtt && (myGPS.getHNRAtt() == true)) // If setAutoHNRAtt was successful and new data is available + if (usingAutoHNRAtt && (myGNSS.getHNRAtt() == true)) // If setAutoHNRAtt was successful and new data is available { Serial.print(F("Roll: ")); // Print selected data - Serial.print(myGPS.getHNRroll(), 2); // Use the helper function to get the roll in degrees + Serial.print(myGNSS.getHNRroll(), 2); // Use the helper function to get the roll in degrees Serial.print(F(" Pitch: ")); - Serial.print(myGPS.getHNRpitch(), 2); // Use the helper function to get the pitch in degrees + Serial.print(myGNSS.getHNRpitch(), 2); // Use the helper function to get the pitch in degrees Serial.print(F(" Heading: ")); - Serial.println(myGPS.getHNRheading(), 2); // Use the helper function to get the heading in degrees - myGPS.flushHNRATT(); // Mark data as stale + Serial.println(myGNSS.getHNRheading(), 2); // Use the helper function to get the heading in degrees + myGNSS.flushHNRATT(); // Mark data as stale } - if (usingAutoHNRDyn && (myGPS.getHNRDyn() == true)) // If setAutoHNRDyn was successful and new data is available + if (usingAutoHNRDyn && (myGNSS.getHNRDyn() == true)) // If setAutoHNRDyn was successful and new data is available { Serial.print(F("xAccel: ")); // Print selected data - Serial.print(myGPS.packetUBXHNRINS->data.xAccel); + Serial.print(myGNSS.packetUBXHNRINS->data.xAccel); Serial.print(F(" yAccel: ")); - Serial.print(myGPS.packetUBXHNRINS->data.yAccel); + Serial.print(myGNSS.packetUBXHNRINS->data.yAccel); Serial.print(F(" zAccel: ")); - Serial.println(myGPS.packetUBXHNRINS->data.zAccel); - myGPS.flushHNRINS(); // Mark data as stale + Serial.println(myGNSS.packetUBXHNRINS->data.zAccel); + myGNSS.flushHNRINS(); // Mark data as stale } - if (usingAutoHNRPVT && (myGPS.getHNRPVT() == true)) // If setAutoHNRPVT was successful and new data is available + if (usingAutoHNRPVT && (myGNSS.getHNRPVT() == true)) // If setAutoHNRPVT was successful and new data is available { Serial.print(F("ns: ")); // Print selected data - Serial.print(myGPS.packetUBXHNRPVT->data.nano); + Serial.print(myGNSS.packetUBXHNRPVT->data.nano); Serial.print(F(" Lat: ")); - Serial.print(myGPS.packetUBXHNRPVT->data.lat); + Serial.print(myGNSS.packetUBXHNRPVT->data.lat); Serial.print(F(" Lon: ")); - Serial.println(myGPS.packetUBXHNRPVT->data.lon); - myGPS.flushHNRPVT(); // Mark data as stale + Serial.println(myGNSS.packetUBXHNRPVT->data.lon); + myGNSS.flushHNRPVT(); // Mark data as stale } } diff --git a/examples/Example10_AltitudeMSL/Example10_AltitudeMSL.ino b/examples/Example10_AltitudeMSL/Example10_AltitudeMSL.ino index 9a5c39e..2a8df57 100644 --- a/examples/Example10_AltitudeMSL/Example10_AltitudeMSL.ino +++ b/examples/Example10_AltitudeMSL/Example10_AltitudeMSL.ino @@ -31,7 +31,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Tracks the passing of 2000ms (2 seconds) @@ -43,7 +43,7 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); @@ -58,21 +58,21 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - long altitudeMSL = myGPS.getAltitudeMSL(); + long altitudeMSL = myGNSS.getAltitudeMSL(); Serial.print(F(" AltMSL: ")); Serial.print(altitudeMSL); Serial.print(F(" (mm)")); diff --git a/examples/Example11_ResetModule/Example1_FactoryDefaultviaI2C/Example1_FactoryDefaultviaI2C.ino b/examples/Example11_ResetModule/Example1_FactoryDefaultviaI2C/Example1_FactoryDefaultviaI2C.ino index 6da8b00..4bc95ee 100644 --- a/examples/Example11_ResetModule/Example1_FactoryDefaultviaI2C/Example1_FactoryDefaultviaI2C.ino +++ b/examples/Example11_ResetModule/Example1_FactoryDefaultviaI2C/Example1_FactoryDefaultviaI2C.ino @@ -19,8 +19,8 @@ Open the serial monitor at 115200 baud to see the output */ -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -30,7 +30,7 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); @@ -40,11 +40,11 @@ void setup() Serial.println("Press a key to reset module to factory defaults"); while (Serial.available() == false) ; //Wait for user to send character - myGPS.factoryReset(); //Reset everything: baud rate, I2C address, update rate, everything. + myGNSS.factoryReset(); //Reset everything: baud rate, I2C address, update rate, everything. delay(5000); // Wait while the module restarts - while (myGPS.begin() == false) //Attempt to re-connect + while (myGNSS.begin() == false) //Attempt to re-connect { delay(1000); Serial.println(F("Attempting to re-connect to u-blox GNSS...")); diff --git a/examples/Example11_ResetModule/Example2_FactoryDefaultsviaSerial/Example2_FactoryDefaultsviaSerial.ino b/examples/Example11_ResetModule/Example2_FactoryDefaultsviaSerial/Example2_FactoryDefaultsviaSerial.ino index fe974b6..4493f7a 100644 --- a/examples/Example11_ResetModule/Example2_FactoryDefaultsviaSerial/Example2_FactoryDefaultsviaSerial.ino +++ b/examples/Example11_ResetModule/Example2_FactoryDefaultsviaSerial/Example2_FactoryDefaultsviaSerial.ino @@ -19,8 +19,8 @@ Open the serial monitor at 115200 baud to see the output */ -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; #include @@ -40,7 +40,7 @@ void setup() while (!Serial); //Wait for user to open terminal Serial.println("SparkFun u-blox Example"); - //myGPS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial } void loop() @@ -52,30 +52,30 @@ void loop() do { Serial.println("GNSS: trying 38400 baud"); mySerial.begin(38400); - if (myGPS.begin(mySerial)) break; + if (myGNSS.begin(mySerial)) break; delay(100); Serial.println("GNSS: trying 9600 baud"); mySerial.begin(9600); - if (myGPS.begin(mySerial)) { + if (myGNSS.begin(mySerial)) { Serial.println("GNSS: connected at 9600 baud, switching to 38400"); - myGPS.setSerialRate(38400); + myGNSS.setSerialRate(38400); delay(100); } else { delay(2000); //Wait a bit before trying again to limit the Serial output flood } } while(1); - myGPS.setUART1Output(COM_TYPE_UBX); //Set the UART port to output UBX only - myGPS.saveConfiguration(); //Save the current settings to flash and BBR + myGNSS.setUART1Output(COM_TYPE_UBX); //Set the UART port to output UBX only + myGNSS.saveConfiguration(); //Save the current settings to flash and BBR Serial.println("GNSS serial connected, saved config"); state++; break; case 1: // hardReset, expect to see GNSS back at 38400 baud Serial.println("Issuing hardReset (cold start)"); - myGPS.hardReset(); + myGNSS.hardReset(); delay(2000); mySerial.begin(38400); - if (myGPS.begin(mySerial)) { + if (myGNSS.begin(mySerial)) { Serial.println("Success."); state++; } else { @@ -85,10 +85,10 @@ void loop() break; case 2: // factoryReset, expect to see GNSS back at defaultRate baud Serial.println("Issuing factoryReset"); - myGPS.factoryReset(); + myGNSS.factoryReset(); delay(5000); // takes more than one second... a loop to resync would be best mySerial.begin(defaultRate); - if (myGPS.begin(mySerial)) { + if (myGNSS.begin(mySerial)) { Serial.println("Success."); state++; } else { @@ -100,9 +100,9 @@ void loop() // Note: this may fail on boards like the UNO (ATmega328P) with modules like the ZED-F9P // because getProtocolVersion returns a lot of data - more than the UNO's serial buffer can hold Serial.print("GNSS protocol version: "); - Serial.print(myGPS.getProtocolVersionHigh()); + Serial.print(myGNSS.getProtocolVersionHigh()); Serial.print('.'); - Serial.println(myGPS.getProtocolVersionLow()); + Serial.println(myGNSS.getProtocolVersionLow()); Serial.println("All finished! Freezing..."); while(1); } diff --git a/examples/Example12_UseUart/Example12_UseUart.ino b/examples/Example12_UseUart/Example12_UseUart.ino index b1add42..6582efc 100644 --- a/examples/Example12_UseUart/Example12_UseUart.ino +++ b/examples/Example12_UseUart/Example12_UseUart.ino @@ -28,7 +28,7 @@ */ #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; #include SoftwareSerial mySerial(10, 11); // RX, TX. Pin 10 on Uno goes to TX pin on GNSS module. @@ -46,25 +46,25 @@ void setup() do { Serial.println("GNSS: trying 38400 baud"); mySerial.begin(38400); - if (myGPS.begin(mySerial) == true) break; + if (myGNSS.begin(mySerial) == true) break; delay(100); Serial.println("GNSS: trying 9600 baud"); mySerial.begin(9600); - if (myGPS.begin(mySerial) == true) { + if (myGNSS.begin(mySerial) == true) { Serial.println("GNSS: connected at 9600 baud, switching to 38400"); - myGPS.setSerialRate(38400); + myGNSS.setSerialRate(38400); delay(100); } else { - //myGPS.factoryReset(); + //myGNSS.factoryReset(); delay(2000); //Wait a bit before trying again to limit the Serial output } } while(1); Serial.println("GNSS serial connected"); - myGPS.setUART1Output(COM_TYPE_UBX); //Set the UART port to output UBX only - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfiguration(); //Save the current settings to flash and BBR + myGNSS.setUART1Output(COM_TYPE_UBX); //Set the UART port to output UBX only + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfiguration(); //Save the current settings to flash and BBR } void loop() @@ -75,21 +75,21 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); diff --git a/examples/Example13_PVT/Example1_AutoPVT/Example1_AutoPVT.ino b/examples/Example13_PVT/Example1_AutoPVT/Example1_AutoPVT.ino index d5dd31d..f82d4bc 100644 --- a/examples/Example13_PVT/Example1_AutoPVT/Example1_AutoPVT.ino +++ b/examples/Example13_PVT/Example1_AutoPVT/Example1_AutoPVT.ino @@ -28,8 +28,8 @@ #include //Needed for I2C to GNSS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -39,95 +39,95 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.setNavigationFrequency(2); //Produce two solutions per second - myGPS.setAutoPVT(true); //Tell the GNSS to "send" each solution - //myGPS.saveConfiguration(); //Optional: Save the current settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setNavigationFrequency(2); //Produce two solutions per second + myGNSS.setAutoPVT(true); //Tell the GNSS to "send" each solution + //myGNSS.saveConfiguration(); //Optional: Save the current settings to flash and BBR } void loop() { // Calling getPVT returns true if there actually is a fresh navigation solution available. // Start the reading only when valid LLH is available - if (myGPS.getPVT() && (myGPS.getInvalidLlh() == false)) + if (myGNSS.getPVT() && (myGNSS.getInvalidLlh() == false)) { Serial.println(); - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); - int PDOP = myGPS.getPDOP(); + int PDOP = myGNSS.getPDOP(); Serial.print(F(" PDOP: ")); Serial.print(PDOP); Serial.print(F(" (10^-2)")); - int nedNorthVel = myGPS.getNedNorthVel(); + int nedNorthVel = myGNSS.getNedNorthVel(); Serial.print(F(" VelN: ")); Serial.print(nedNorthVel); Serial.print(F(" (mm/s)")); - int nedEastVel = myGPS.getNedEastVel(); + int nedEastVel = myGNSS.getNedEastVel(); Serial.print(F(" VelE: ")); Serial.print(nedEastVel); Serial.print(F(" (mm/s)")); - int nedDownVel = myGPS.getNedDownVel(); + int nedDownVel = myGNSS.getNedDownVel(); Serial.print(F(" VelD: ")); Serial.print(nedDownVel); Serial.print(F(" (mm/s)")); - int verticalAccEst = myGPS.getVerticalAccEst(); + int verticalAccEst = myGNSS.getVerticalAccEst(); Serial.print(F(" VAccEst: ")); Serial.print(verticalAccEst); Serial.print(F(" (mm)")); - int horizontalAccEst = myGPS.getHorizontalAccEst(); + int horizontalAccEst = myGNSS.getHorizontalAccEst(); Serial.print(F(" HAccEst: ")); Serial.print(horizontalAccEst); Serial.print(F(" (mm)")); - int speedAccEst = myGPS.getSpeedAccEst(); + int speedAccEst = myGNSS.getSpeedAccEst(); Serial.print(F(" SpeedAccEst: ")); Serial.print(speedAccEst); Serial.print(F(" (mm/s)")); - int headAccEst = myGPS.getHeadingAccEst(); + int headAccEst = myGNSS.getHeadingAccEst(); Serial.print(F(" HeadAccEst: ")); Serial.print(headAccEst); Serial.print(F(" (degrees * 10^-5)")); - if (myGPS.getHeadVehValid() == true) { - int headVeh = myGPS.getHeadVeh(); + if (myGNSS.getHeadVehValid() == true) { + int headVeh = myGNSS.getHeadVeh(); Serial.print(F(" HeadVeh: ")); Serial.print(headVeh); Serial.print(F(" (degrees * 10^-5)")); - int magDec = myGPS.getMagDec(); + int magDec = myGNSS.getMagDec(); Serial.print(F(" MagDec: ")); Serial.print(magDec); Serial.print(F(" (degrees * 10^-2)")); - int magAcc = myGPS.getMagAcc(); + int magAcc = myGNSS.getMagAcc(); Serial.print(F(" MagAcc: ")); Serial.print(magAcc); Serial.print(F(" (degrees * 10^-2)")); diff --git a/examples/Example13_PVT/Example2_AutoPVT_ExplicitUpdate/Example2_AutoPVT_ExplicitUpdate.ino b/examples/Example13_PVT/Example2_AutoPVT_ExplicitUpdate/Example2_AutoPVT_ExplicitUpdate.ino index 92f85b3..429b2ad 100644 --- a/examples/Example13_PVT/Example2_AutoPVT_ExplicitUpdate/Example2_AutoPVT_ExplicitUpdate.ino +++ b/examples/Example13_PVT/Example2_AutoPVT_ExplicitUpdate/Example2_AutoPVT_ExplicitUpdate.ino @@ -29,8 +29,8 @@ #include //Needed for I2C to GNSS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -41,17 +41,17 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.setNavigationFrequency(2); //Produce two solutions per second - myGPS.setAutoPVT(true, false); //Tell the GNSS to "send" each solution and the lib not to update stale data implicitly - //myGPS.saveConfiguration(); //Optional: Save the current settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setNavigationFrequency(2); //Produce two solutions per second + myGNSS.setAutoPVT(true, false); //Tell the GNSS to "send" each solution and the lib not to update stale data implicitly + //myGNSS.saveConfiguration(); //Optional: Save the current settings to flash and BBR } /* @@ -73,21 +73,21 @@ void loop() if (counter % 500 == 0) { Serial.println(); - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); @@ -96,7 +96,7 @@ void loop() // call checkUblox all 50ms to capture the GNSS data if (counter % 50 == 0) { - myGPS.checkUblox(); + myGNSS.checkUblox(); } delay(1); counter++; diff --git a/examples/Example13_PVT/Example3_AutoPVTviaUart/Example3_AutoPVTviaUart.ino b/examples/Example13_PVT/Example3_AutoPVTviaUart/Example3_AutoPVTviaUart.ino index 53e75c3..16ea890 100644 --- a/examples/Example13_PVT/Example3_AutoPVTviaUart/Example3_AutoPVTviaUart.ino +++ b/examples/Example13_PVT/Example3_AutoPVTviaUart/Example3_AutoPVTviaUart.ino @@ -29,7 +29,7 @@ */ #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; #include @@ -49,16 +49,16 @@ void setup() mySerial.begin(baudRate); // Start the Serial port - if (myGPS.begin(mySerial) == false) //Connect to the u-blox module using Serial + if (myGNSS.begin(mySerial) == false) //Connect to the u-blox module using Serial { Serial.println(F("u-blox GNSS not detected. Please check wiring. Freezing.")); while (1); } - myGPS.setUART1Output(COM_TYPE_UBX); //Set the UART1 port to output UBX only (turn off NMEA noise) - myGPS.setNavigationFrequency(2); //Produce two solutions per second - myGPS.setAutoPVT(true); //Tell the GNSS to "send" each solution - //myGPS.saveConfiguration(); //Optional: Save the current settings to flash and BBR + myGNSS.setUART1Output(COM_TYPE_UBX); //Set the UART1 port to output UBX only (turn off NMEA noise) + myGNSS.setNavigationFrequency(2); //Produce two solutions per second + myGNSS.setAutoPVT(true); //Tell the GNSS to "send" each solution + //myGNSS.saveConfiguration(); //Optional: Save the current settings to flash and BBR } void loop() @@ -68,25 +68,25 @@ void loop() // to prevent serial buffer overflows on boards like the original RedBoard / UNO. // At 38400 Baud, the 100 PVT bytes will arrive in 26ms. // On the RedBoard, we need to call getPVT every 5ms to keep up. - if (myGPS.getPVT()) + if (myGNSS.getPVT()) { Serial.println(); - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); diff --git a/examples/Example13_PVT/Example4_AssumeAutoPVTviaUart/Example4_AssumeAutoPVTviaUart.ino b/examples/Example13_PVT/Example4_AssumeAutoPVTviaUart/Example4_AssumeAutoPVTviaUart.ino index 6045a01..7709691 100644 --- a/examples/Example13_PVT/Example4_AssumeAutoPVTviaUart/Example4_AssumeAutoPVTviaUart.ino +++ b/examples/Example13_PVT/Example4_AssumeAutoPVTviaUart/Example4_AssumeAutoPVTviaUart.ino @@ -30,7 +30,7 @@ */ #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; #include @@ -52,11 +52,11 @@ void setup() //Assume that the U-Blox GNSS is running at baudRate baud mySerial.begin(baudRate); // No need to check return value as internal call to isConnected() will not succeed - myGPS.begin(mySerial); + myGNSS.begin(mySerial); // Tell the library we are expecting the module to send PVT messages by itself to our Rx pin. // You can set second parameter to "false" if you want to control the parsing and eviction of the data (need to call checkUblox cyclically) - myGPS.assumeAutoPVT(true, true); + myGNSS.assumeAutoPVT(true, true); } @@ -71,25 +71,25 @@ void loop() // to prevent serial buffer overflows on boards like the original RedBoard / UNO. // At 38400 Baud, the 100 PVT bytes will arrive in 26ms. // On the RedBoard, we need to call getPVT every 5ms to keep up. - if (myGPS.getPVT()) + if (myGNSS.getPVT()) { Serial.println(); - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); diff --git a/examples/Example14_DebugOutput/Example14_DebugOutput.ino b/examples/Example14_DebugOutput/Example14_DebugOutput.ino index 983b0de..9dc7701 100644 --- a/examples/Example14_DebugOutput/Example14_DebugOutput.ino +++ b/examples/Example14_DebugOutput/Example14_DebugOutput.ino @@ -27,7 +27,7 @@ */ #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; unsigned long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. int counter = 0; // Disable the debug messages when counter reaches 20 @@ -40,20 +40,20 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the Ublox module using Wire port + if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - //myGPS.saveConfiguration(); //Optional: Save the current settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + //myGNSS.saveConfiguration(); //Optional: Save the current settings to flash and BBR - myGPS.enableDebugging(); //Enable all the debug messages over Serial (default) + myGNSS.enableDebugging(); //Enable all the debug messages over Serial (default) - //myGPS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB + //myGNSS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB - //myGPS.enableDebugging(Serial, true); //Enable only the critical debug messages over Serial + //myGNSS.enableDebugging(Serial, true); //Enable only the critical debug messages over Serial } @@ -65,43 +65,43 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); Serial.print(F(" ")); - Serial.print(myGPS.getYear()); + Serial.print(myGNSS.getYear()); Serial.print(F("-")); - Serial.print(myGPS.getMonth()); + Serial.print(myGNSS.getMonth()); Serial.print(F("-")); - Serial.print(myGPS.getDay()); + Serial.print(myGNSS.getDay()); Serial.print(F(" ")); - Serial.print(myGPS.getHour()); + Serial.print(myGNSS.getHour()); Serial.print(F(":")); - Serial.print(myGPS.getMinute()); + Serial.print(myGNSS.getMinute()); Serial.print(F(":")); - Serial.println(myGPS.getSecond()); + Serial.println(myGNSS.getSecond()); Serial.println(); counter++; // Increment counter if (counter == 20) { - myGPS.disableDebugging(); // Disable the debug messages when counter reaches 20 + myGNSS.disableDebugging(); // Disable the debug messages when counter reaches 20 } } } diff --git a/examples/Example15_GetDateTime/Example15_GetDateTime.ino b/examples/Example15_GetDateTime/Example15_GetDateTime.ino index abfe800..8f97b65 100644 --- a/examples/Example15_GetDateTime/Example15_GetDateTime.ino +++ b/examples/Example15_GetDateTime/Example15_GetDateTime.ino @@ -27,7 +27,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -40,15 +40,15 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - //myGPS.saveConfiguration(); //Optional: Save the current settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + //myGNSS.saveConfiguration(); //Optional: Save the current settings to flash and BBR } void loop() @@ -59,44 +59,44 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); Serial.println(); - Serial.print(myGPS.getYear()); + Serial.print(myGNSS.getYear()); Serial.print("-"); - Serial.print(myGPS.getMonth()); + Serial.print(myGNSS.getMonth()); Serial.print("-"); - Serial.print(myGPS.getDay()); + Serial.print(myGNSS.getDay()); Serial.print(" "); - Serial.print(myGPS.getHour()); + Serial.print(myGNSS.getHour()); Serial.print(":"); - Serial.print(myGPS.getMinute()); + Serial.print(myGNSS.getMinute()); Serial.print(":"); - Serial.print(myGPS.getSecond()); + Serial.print(myGNSS.getSecond()); Serial.print(" Time is "); - if (myGPS.getTimeValid() == false) + if (myGNSS.getTimeValid() == false) { Serial.print("not "); } Serial.print("valid Date is "); - if (myGPS.getDateValid() == false) + if (myGNSS.getDateValid() == false) { Serial.print("not "); } diff --git a/examples/Example16_Nanosecond_MaxOutput/Example16_Nanosecond_MaxOutput.ino b/examples/Example16_Nanosecond_MaxOutput/Example16_Nanosecond_MaxOutput.ino index f349364..04a1929 100644 --- a/examples/Example16_Nanosecond_MaxOutput/Example16_Nanosecond_MaxOutput.ino +++ b/examples/Example16_Nanosecond_MaxOutput/Example16_Nanosecond_MaxOutput.ino @@ -29,7 +29,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -43,21 +43,21 @@ void setup() Wire.begin(); Wire.setClock(400000); // Increase I2C clock speed to 400kHz - //myGPS.enableDebugging(); //Uncomment this line to enable debug messages over Serial + //myGNSS.enableDebugging(); //Uncomment this line to enable debug messages over Serial - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - //myGPS.saveConfiguration(); //Optional: Save the current settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + //myGNSS.saveConfiguration(); //Optional: Save the current settings to flash and BBR - myGPS.setNavigationFrequency(5); //Set output to 5 times a second + myGNSS.setNavigationFrequency(5); //Set output to 5 times a second - byte rate = myGPS.getNavigationFrequency(); //Get the update rate of this module + byte rate = myGNSS.getNavigationFrequency(); //Get the update rate of this module Serial.print("Current update rate: "); Serial.println(rate); } @@ -65,44 +65,44 @@ void setup() void loop() { // Calling getPVT returns true if there actually is a fresh navigation solution available. - if (myGPS.getPVT()) + if (myGNSS.getPVT()) { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); Serial.print(" "); - Serial.print(myGPS.getYear()); + Serial.print(myGNSS.getYear()); Serial.print("-"); - Serial.print(myGPS.getMonth()); + Serial.print(myGNSS.getMonth()); Serial.print("-"); - Serial.print(myGPS.getDay()); + Serial.print(myGNSS.getDay()); Serial.print(" "); - Serial.print(myGPS.getHour()); + Serial.print(myGNSS.getHour()); Serial.print(":"); - Serial.print(myGPS.getMinute()); + Serial.print(myGNSS.getMinute()); Serial.print(":"); - Serial.print(myGPS.getSecond()); + Serial.print(myGNSS.getSecond()); Serial.print("."); - Serial.print(myGPS.getNanosecond()); + Serial.print(myGNSS.getNanosecond()); - myGPS.flushPVT(); + myGNSS.flushPVT(); Serial.println(); } diff --git a/examples/Example16_PartialSecond_MaxOutput/Example16_PartialSecond_MaxOutput.ino b/examples/Example16_PartialSecond_MaxOutput/Example16_PartialSecond_MaxOutput.ino index b644985..d93df93 100644 --- a/examples/Example16_PartialSecond_MaxOutput/Example16_PartialSecond_MaxOutput.ino +++ b/examples/Example16_PartialSecond_MaxOutput/Example16_PartialSecond_MaxOutput.ino @@ -28,7 +28,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -42,68 +42,68 @@ void setup() Wire.begin(); Wire.setClock(400000); // Increase I2C clock speed to 400kHz - //myGPS.enableDebugging(); //Uncomment this line to enable debug messages over Serial + //myGNSS.enableDebugging(); //Uncomment this line to enable debug messages over Serial - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) // Note: not all u-blox modules can output solutions at 10Hz - or not while tracking all satellite constellations // If the rate drops back to 1Hz, you're asking too much of your module - myGPS.setNavigationFrequency(10); //Set output to 10 times a second + myGNSS.setNavigationFrequency(10); //Set output to 10 times a second - byte rate = myGPS.getNavigationFrequency(); //Get the update rate of this module + byte rate = myGNSS.getNavigationFrequency(); //Get the update rate of this module Serial.print("Current update rate:"); Serial.println(rate); - //myGPS.saveConfiguration(); //Optional: Save the current settings to flash and BBR + //myGNSS.saveConfiguration(); //Optional: Save the current settings to flash and BBR } void loop() { // Calling getPVT returns true if there actually is a fresh navigation solution available. - if (myGPS.getPVT()) + if (myGNSS.getPVT()) { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); Serial.print(" "); - Serial.print(myGPS.getYear()); + Serial.print(myGNSS.getYear()); Serial.print("-"); - Serial.print(myGPS.getMonth()); + Serial.print(myGNSS.getMonth()); Serial.print("-"); - Serial.print(myGPS.getDay()); + Serial.print(myGNSS.getDay()); Serial.print(" "); - Serial.print(myGPS.getHour()); + Serial.print(myGNSS.getHour()); Serial.print(":"); - Serial.print(myGPS.getMinute()); + Serial.print(myGNSS.getMinute()); Serial.print(":"); - Serial.print(myGPS.getSecond()); + Serial.print(myGNSS.getSecond()); Serial.print("."); //Pretty print leading zeros - int mseconds = myGPS.getMillisecond(); + int mseconds = myGNSS.getMillisecond(); if (mseconds < 100) Serial.print("0"); if (mseconds < 10) @@ -111,7 +111,7 @@ void loop() Serial.print(mseconds); Serial.print(" nanoSeconds: "); - Serial.print(myGPS.getNanosecond()); + Serial.print(myGNSS.getNanosecond()); Serial.println(); } diff --git a/examples/Example17_Geofence/Example17_Geofence.ino b/examples/Example17_Geofence/Example17_Geofence.ino index 36ad944..b18f5e5 100644 --- a/examples/Example17_Geofence/Example17_Geofence.ino +++ b/examples/Example17_Geofence/Example17_Geofence.ino @@ -30,7 +30,7 @@ #include // Needed for I2C #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -51,14 +51,14 @@ void setup() delay(1000); // Let the GNSS power up - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - //myGPS.enableDebugging(); // Enable debug messages - myGPS.setI2COutput(COM_TYPE_UBX); // Limit I2C output to UBX (disable the NMEA noise) + //myGNSS.enableDebugging(); // Enable debug messages + myGNSS.setI2COutput(COM_TYPE_UBX); // Limit I2C output to UBX (disable the NMEA noise) Serial.println(F("Waiting for a 3D fix...")); @@ -66,7 +66,7 @@ void setup() while (fixType < 3) { - fixType = myGPS.getFixType(); // Get the fix type + fixType = myGNSS.getFixType(); // Get the fix type Serial.print(F("Fix: ")); // Print it Serial.print(fixType); if(fixType == 0) Serial.print(F(" = No fix")); @@ -81,11 +81,11 @@ void setup() Serial.println(F("3D fix found!")); - long latitude = myGPS.getLatitude(); // Get the latitude in degrees * 10^-7 + long latitude = myGNSS.getLatitude(); // Get the latitude in degrees * 10^-7 Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); // Get the longitude in degrees * 10^-7 + long longitude = myGNSS.getLongitude(); // Get the longitude in degrees * 10^-7 Serial.print(F(" Long: ")); Serial.println(longitude); @@ -95,33 +95,33 @@ void setup() // Call clearGeofences() to clear all existing geofences. Serial.print(F("Clearing any existing geofences. clearGeofences returned: ")); - Serial.println(myGPS.clearGeofences()); + Serial.println(myGNSS.clearGeofences()); // It is possible to define up to four geofences. // Call addGeofence up to four times to define them. Serial.println(F("Setting the geofences:")); Serial.print(F("addGeofence for geofence 1 returned: ")); - Serial.println(myGPS.addGeofence(latitude, longitude, radius, confidence)); + Serial.println(myGNSS.addGeofence(latitude, longitude, radius, confidence)); radius = 1000; // 10m Serial.print(F("addGeofence for geofence 2 returned: ")); - Serial.println(myGPS.addGeofence(latitude, longitude, radius, confidence)); + Serial.println(myGNSS.addGeofence(latitude, longitude, radius, confidence)); radius = 1500; // 15m Serial.print(F("addGeofence for geofence 3 returned: ")); - Serial.println(myGPS.addGeofence(latitude, longitude, radius, confidence)); + Serial.println(myGNSS.addGeofence(latitude, longitude, radius, confidence)); radius = 2000; // 20m Serial.print(F("addGeofence for geofence 4 returned: ")); - Serial.println(myGPS.addGeofence(latitude, longitude, radius, confidence)); + Serial.println(myGNSS.addGeofence(latitude, longitude, radius, confidence)); } void loop() { geofenceState currentGeofenceState; // Create storage for the geofence state - boolean result = myGPS.getGeofenceState(currentGeofenceState); + boolean result = myGNSS.getGeofenceState(currentGeofenceState); Serial.print(F("getGeofenceState returned: ")); // Print the combined state Serial.print(result); // Get the geofence state diff --git a/examples/Example18_PowerSaveMode/Example18_PowerSaveMode.ino b/examples/Example18_PowerSaveMode/Example18_PowerSaveMode.ino index 32957b8..5a4ad30 100644 --- a/examples/Example18_PowerSaveMode/Example18_PowerSaveMode.ino +++ b/examples/Example18_PowerSaveMode/Example18_PowerSaveMode.ino @@ -41,7 +41,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -54,17 +54,17 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - //myGPS.saveConfiguration(); //Optional: Uncomment this line to save the current settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + //myGNSS.saveConfiguration(); //Optional: Uncomment this line to save the current settings to flash and BBR Serial.println("Power save example."); Serial.println("1) Enable power saving"); @@ -80,9 +80,9 @@ void loop() if (incoming == '1') { // Put the GNSS into power save mode - // (If you want to disable power save mode, call myGPS.powerSaveMode(false) instead) + // (If you want to disable power save mode, call myGNSS.powerSaveMode(false) instead) // This will fail on the ZED (protocol version >= 27) as UBX-CFG-RXM is not supported - if (myGPS.powerSaveMode()) // Defaults to true + if (myGNSS.powerSaveMode()) // Defaults to true Serial.println(F("Power Save Mode enabled.")); else Serial.println(F("***!!! Power Save Mode FAILED !!!***")); @@ -90,14 +90,14 @@ void loop() else if (incoming == '2') { //Go to normal power mode (not power saving mode) - if (myGPS.powerSaveMode(false)) + if (myGNSS.powerSaveMode(false)) Serial.println(F("Power Save Mode disabled.")); else Serial.println(F("***!!! Power Save Disable FAILED !!!***")); } // Read and print the new low power mode - uint8_t lowPowerMode = myGPS.getPowerSaveMode(); + uint8_t lowPowerMode = myGNSS.getPowerSaveMode(); if (lowPowerMode == 255) { Serial.println(F("***!!! getPowerSaveMode FAILED !!!***")); @@ -130,7 +130,7 @@ void loop() { lastTime = millis(); //Update the timer - byte fixType = myGPS.getFixType(); // Get the fix type + byte fixType = myGNSS.getFixType(); // Get the fix type Serial.print(F("Fix: ")); Serial.print(fixType); if (fixType == 0) @@ -144,16 +144,16 @@ void loop() else if (fixType == 4) Serial.print(F("(GNSS + Dead reckoning)")); - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F(" Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); diff --git a/examples/Example19_DynamicModel/Example19_DynamicModel.ino b/examples/Example19_DynamicModel/Example19_DynamicModel.ino index 9459d6d..2f6a5ce 100644 --- a/examples/Example19_DynamicModel/Example19_DynamicModel.ino +++ b/examples/Example19_DynamicModel/Example19_DynamicModel.ino @@ -38,7 +38,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -51,22 +51,22 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) // If we are going to change the dynamic platform model, let's do it here. // Possible values are: // PORTABLE, STATIONARY, PEDESTRIAN, AUTOMOTIVE, SEA, AIRBORNE1g, AIRBORNE2g, AIRBORNE4g, WRIST, BIKE - if (myGPS.setDynamicModel(DYN_MODEL_PORTABLE) == false) // Set the dynamic model to PORTABLE + if (myGNSS.setDynamicModel(DYN_MODEL_PORTABLE) == false) // Set the dynamic model to PORTABLE { Serial.println(F("***!!! Warning: setDynamicModel failed !!!***")); } @@ -76,7 +76,7 @@ void setup() } // Let's read the new dynamic model to see if it worked - uint8_t newDynamicModel = myGPS.getDynamicModel(); + uint8_t newDynamicModel = myGNSS.getDynamicModel(); if (newDynamicModel == DYN_MODEL_UNKNOWN) { Serial.println(F("***!!! Warning: getDynamicModel failed !!!***")); @@ -87,7 +87,7 @@ void setup() Serial.println(newDynamicModel); } - //myGPS.saveConfigSelective(VAL_CFG_SUBSEC_NAVCONF); //Uncomment this line to save only the NAV settings to flash and BBR + //myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_NAVCONF); //Uncomment this line to save only the NAV settings to flash and BBR } void loop() @@ -98,16 +98,16 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); diff --git a/examples/Example1_BasicNMEARead/Example1_BasicNMEARead.ino b/examples/Example1_BasicNMEARead/Example1_BasicNMEARead.ino index 8798986..1870721 100644 --- a/examples/Example1_BasicNMEARead/Example1_BasicNMEARead.ino +++ b/examples/Example1_BasicNMEARead/Example1_BasicNMEARead.ino @@ -24,7 +24,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_Ublox_GPS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -33,19 +33,19 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) + if (myGNSS.begin() == false) { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } //This will pipe all NMEA sentences to the serial port so we can see them - myGPS.setNMEAOutputPort(Serial); + myGNSS.setNMEAOutputPort(Serial); } void loop() { - myGPS.checkUblox(); //See if new data is available. Process bytes as they come in. + myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in. delay(250); //Don't pound too hard on the I2C bus } diff --git a/examples/Example20_SendCustomCommand/Example20_SendCustomCommand.ino b/examples/Example20_SendCustomCommand/Example20_SendCustomCommand.ino index c6b016e..d899fd6 100644 --- a/examples/Example20_SendCustomCommand/Example20_SendCustomCommand.ino +++ b/examples/Example20_SendCustomCommand/Example20_SendCustomCommand.ino @@ -37,7 +37,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -48,16 +48,16 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) // Let's configure the module's navigation rate as if we were using setNavigationFrequency @@ -96,7 +96,7 @@ void setup() uint16_t maxWait = 250; // Wait for up to 250ms (Serial may need a lot longer e.g. 1100) // Now let's read the current navigation rate. The results will be loaded into customCfg. - if (myGPS.sendCommand(&customCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK + if (myGNSS.sendCommand(&customCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK { Serial.println(F("sendCommand (poll / get) failed! Freezing...")); while (1) @@ -126,7 +126,7 @@ void setup() // when sendCommand read the data // Now we write the custom packet back again to change the setting - if (myGPS.sendCommand(&customCfg, maxWait) != SFE_UBLOX_STATUS_DATA_SENT) // This time we are only expecting an ACK + if (myGNSS.sendCommand(&customCfg, maxWait) != SFE_UBLOX_STATUS_DATA_SENT) // This time we are only expecting an ACK { Serial.println(F("sendCommand (set) failed! Freezing.")); while (1) @@ -137,29 +137,29 @@ void setup() Serial.println(F("Navigation rate updated. Here we go...")); } - myGPS.setAutoPVT(true); // Enable AutoPVT. The module will generate measurements automatically without being polled. + myGNSS.setAutoPVT(true); // Enable AutoPVT. The module will generate measurements automatically without being polled. - //myGPS.saveConfigSelective(VAL_CFG_SUBSEC_NAVCONF); //Uncomment this line to save only the NAV settings to flash and BBR + //myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_NAVCONF); //Uncomment this line to save only the NAV settings to flash and BBR } void loop() { //Query the module as fast as possible - int32_t latitude = myGPS.getLatitude(); + int32_t latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - int32_t longitude = myGPS.getLongitude(); + int32_t longitude = myGNSS.getLongitude(); Serial.print(F(" Lon: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - int32_t altitude = myGPS.getAltitude(); + int32_t altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - uint16_t milliseconds = myGPS.getMillisecond(); + uint16_t milliseconds = myGNSS.getMillisecond(); Serial.print(F(" Milliseconds: ")); Serial.print(altitude); Serial.println(); diff --git a/examples/Example21_ModuleInfo/Example21_ModuleInfo.ino b/examples/Example21_ModuleInfo/Example21_ModuleInfo.ino index f5f8178..4e64d0b 100644 --- a/examples/Example21_ModuleInfo/Example21_ModuleInfo.ino +++ b/examples/Example21_ModuleInfo/Example21_ModuleInfo.ino @@ -42,7 +42,7 @@ #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS // Extend the class for getModuleInfo -class SFE_UBLOX_GPS_ADD : public SFE_UBLOX_GPS +class SFE_UBLOX_GPS_ADD : public SFE_UBLOX_GNSS { public: boolean getModuleInfo(uint16_t maxWait = 1100); //Queries module, texts @@ -56,7 +56,7 @@ public: } minfo; }; -SFE_UBLOX_GPS_ADD myGPS; +SFE_UBLOX_GPS_ADD myGNSS; void setup() { @@ -67,19 +67,19 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) Serial.print(F("Polling module info")); - if (myGPS.getModuleInfo(1100) == false) // Try to get the module info + if (myGNSS.getModuleInfo(1100) == false) // Try to get the module info { Serial.print(F("getModuleInfo failed! Freezing...")); while (1) @@ -90,15 +90,15 @@ void setup() Serial.println(); Serial.println(F("Module Info : ")); Serial.print(F("Soft version: ")); - Serial.println(myGPS.minfo.swVersion); + Serial.println(myGNSS.minfo.swVersion); Serial.print(F("Hard version: ")); - Serial.println(myGPS.minfo.hwVersion); + Serial.println(myGNSS.minfo.hwVersion); Serial.print(F("Extensions:")); - Serial.println(myGPS.minfo.extensionNo); - for (int i = 0; i < myGPS.minfo.extensionNo; i++) + Serial.println(myGNSS.minfo.extensionNo); + for (int i = 0; i < myGNSS.minfo.extensionNo; i++) { Serial.print(" "); - Serial.println(myGPS.minfo.extension[i]); + Serial.println(myGNSS.minfo.extension[i]); } Serial.println(); Serial.println(F("Done!")); @@ -110,11 +110,11 @@ void loop() boolean SFE_UBLOX_GPS_ADD::getModuleInfo(uint16_t maxWait) { - myGPS.minfo.hwVersion[0] = 0; - myGPS.minfo.swVersion[0] = 0; + myGNSS.minfo.hwVersion[0] = 0; + myGNSS.minfo.swVersion[0] = 0; for (int i = 0; i < 10; i++) - myGPS.minfo.extension[i][0] = 0; - myGPS.minfo.extensionNo = 0; + myGNSS.minfo.extension[i][0] = 0; + myGNSS.minfo.extensionNo = 0; // Let's create our custom packet uint8_t customPayload[MAX_PAYLOAD_SIZE]; // This array holds the payload data bytes diff --git a/examples/Example22_PowerOff/Example22_PowerOff.ino b/examples/Example22_PowerOff/Example22_PowerOff.ino index e091f20..50c292b 100644 --- a/examples/Example22_PowerOff/Example22_PowerOff.ino +++ b/examples/Example22_PowerOff/Example22_PowerOff.ino @@ -27,7 +27,7 @@ */ #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; // define a digital pin capable of driving HIGH and LOW #define WAKEUP_PIN 5 @@ -63,9 +63,9 @@ void setup() { Wire.begin(); - //myGPS.enableDebugging(); // Enable debug messages + //myGNSS.enableDebugging(); // Enable debug messages - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); @@ -74,8 +74,8 @@ void setup() { // Powering off for 20s, you should see the power consumption drop. Serial.println("-- Powering off module for 20s --"); - myGPS.powerOff(20000); - //myGPS.powerOffWithInterrupt(20000, VAL_RXM_PMREQ_WAKEUPSOURCE_EXTINT0); + myGNSS.powerOff(20000); + //myGNSS.powerOffWithInterrupt(20000, VAL_RXM_PMREQ_WAKEUPSOURCE_EXTINT0); delay(10000); diff --git a/examples/Example2_NMEAParsing/Example2_NMEAParsing.ino b/examples/Example2_NMEAParsing/Example2_NMEAParsing.ino index 224f149..7f7dd6a 100644 --- a/examples/Example2_NMEAParsing/Example2_NMEAParsing.ino +++ b/examples/Example2_NMEAParsing/Example2_NMEAParsing.ino @@ -27,7 +27,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; #include //http://librarymanager/All#MicroNMEA char nmeaBuffer[100]; @@ -40,7 +40,7 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) + if (myGNSS.begin() == false) { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); @@ -49,7 +49,7 @@ void setup() void loop() { - myGPS.checkUblox(); //See if new data is available. Process bytes as they come in. + myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in. if(nmea.isValid() == true) { @@ -75,7 +75,7 @@ void loop() //As each NMEA character comes in you can specify what to do with it //Useful for passing to other libraries like tinyGPS, MicroNMEA, or even //a buffer, radio, etc. -void SFE_UBLOX_GPS::processNMEA(char incoming) +void SFE_UBLOX_GNSS::processNMEA(char incoming) { //Take the incoming char from the u-blox I2C port and pass it on to the MicroNMEA lib //for sentence cracking diff --git a/examples/Example3_GetPosition/Example3_GetPosition.ino b/examples/Example3_GetPosition/Example3_GetPosition.ino index 720c856..55034f6 100644 --- a/examples/Example3_GetPosition/Example3_GetPosition.ino +++ b/examples/Example3_GetPosition/Example3_GetPosition.ino @@ -31,7 +31,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -43,14 +43,14 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR } void loop() @@ -61,21 +61,21 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - byte SIV = myGPS.getSIV(); + byte SIV = myGNSS.getSIV(); Serial.print(F(" SIV: ")); Serial.print(SIV); diff --git a/examples/Example4_FixType/Example4_FixType.ino b/examples/Example4_FixType/Example4_FixType.ino index 1e8540f..df6c56b 100644 --- a/examples/Example4_FixType/Example4_FixType.ino +++ b/examples/Example4_FixType/Example4_FixType.ino @@ -35,7 +35,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -48,7 +48,7 @@ void setup() Wire.begin(); //Wire.setClock(400000); //Optional. Increase I2C clock speed to 400kHz. - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); @@ -62,19 +62,19 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); - byte fixType = myGPS.getFixType(); + byte fixType = myGNSS.getFixType(); Serial.print(F(" Fix: ")); if(fixType == 0) Serial.print(F("No fix")); else if(fixType == 1) Serial.print(F("Dead reckoning")); @@ -83,7 +83,7 @@ void loop() else if(fixType == 4) Serial.print(F("GNSS + Dead reckoning")); else if(fixType == 5) Serial.print(F("Time only")); - byte RTK = myGPS.getCarrierSolutionType(); + byte RTK = myGNSS.getCarrierSolutionType(); Serial.print(" RTK: "); Serial.print(RTK); if (RTK == 0) Serial.print(F(" (No solution)")); diff --git a/examples/Example5_SpeedHeadingPrecision/Example5_SpeedHeadingPrecision.ino b/examples/Example5_SpeedHeadingPrecision/Example5_SpeedHeadingPrecision.ino index 758c70e..e27f0f7 100644 --- a/examples/Example5_SpeedHeadingPrecision/Example5_SpeedHeadingPrecision.ino +++ b/examples/Example5_SpeedHeadingPrecision/Example5_SpeedHeadingPrecision.ino @@ -29,7 +29,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -41,7 +41,7 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); @@ -56,25 +56,25 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); - long speed = myGPS.getGroundSpeed(); + long speed = myGNSS.getGroundSpeed(); Serial.print(F(" Speed: ")); Serial.print(speed); Serial.print(F(" (mm/s)")); - long heading = myGPS.getHeading(); + long heading = myGNSS.getHeading(); Serial.print(F(" Heading: ")); Serial.print(heading); Serial.print(F(" (degrees * 10^-5)")); - int pDOP = myGPS.getPDOP(); + int pDOP = myGNSS.getPDOP(); Serial.print(F(" pDOP: ")); Serial.print(pDOP / 100.0, 2); // Convert pDOP scaling from 0.01 to 1 diff --git a/examples/Example6_EnableNMEASentences/Example6_EnableNMEASentences.ino b/examples/Example6_EnableNMEASentences/Example6_EnableNMEASentences.ino index 868ae6b..1f96f16 100644 --- a/examples/Example6_EnableNMEASentences/Example6_EnableNMEASentences.ino +++ b/examples/Example6_EnableNMEASentences/Example6_EnableNMEASentences.ino @@ -30,7 +30,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; unsigned long lastGNSSsend = 0; @@ -41,7 +41,7 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) + if (myGNSS.begin() == false) { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) @@ -49,22 +49,22 @@ void setup() } //Disable or enable various NMEA sentences over the UART1 interface - myGPS.disableNMEAMessage(UBX_NMEA_GLL, COM_PORT_UART1); //Several of these are on by default on ublox board so let's disable them - myGPS.disableNMEAMessage(UBX_NMEA_GSA, COM_PORT_UART1); - myGPS.disableNMEAMessage(UBX_NMEA_GSV, COM_PORT_UART1); - myGPS.disableNMEAMessage(UBX_NMEA_RMC, COM_PORT_UART1); - myGPS.enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_UART1); //Only leaving GGA & VTG enabled at current navigation rate - myGPS.enableNMEAMessage(UBX_NMEA_VTG, COM_PORT_UART1); + myGNSS.disableNMEAMessage(UBX_NMEA_GLL, COM_PORT_UART1); //Several of these are on by default on ublox board so let's disable them + myGNSS.disableNMEAMessage(UBX_NMEA_GSA, COM_PORT_UART1); + myGNSS.disableNMEAMessage(UBX_NMEA_GSV, COM_PORT_UART1); + myGNSS.disableNMEAMessage(UBX_NMEA_RMC, COM_PORT_UART1); + myGNSS.enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_UART1); //Only leaving GGA & VTG enabled at current navigation rate + myGNSS.enableNMEAMessage(UBX_NMEA_VTG, COM_PORT_UART1); //Here's the advanced configure method //Some of the other examples in this library enable the PVT message so let's disable it - myGPS.configureMessage(UBX_CLASS_NAV, UBX_NAV_PVT, COM_PORT_UART1, 0); //Message Class, ID, and port we want to configure, sendRate of 0 (disable). + myGNSS.configureMessage(UBX_CLASS_NAV, UBX_NAV_PVT, COM_PORT_UART1, 0); //Message Class, ID, and port we want to configure, sendRate of 0 (disable). - myGPS.setUART1Output(COM_TYPE_NMEA); //Turn off UBX and RTCM sentences on the UART1 interface + myGNSS.setUART1Output(COM_TYPE_NMEA); //Turn off UBX and RTCM sentences on the UART1 interface - myGPS.setSerialRate(57600); //Set UART1 to 57600bps. + myGNSS.setSerialRate(57600); //Set UART1 to 57600bps. - //myGPS.saveConfiguration(); //Optional: Save these settings to NVM + //myGNSS.saveConfiguration(); //Optional: Save these settings to NVM Serial.println(F("Messages configured. NMEA now being output over the UART1 port on the u-blox module at 57600bps.")); } @@ -73,7 +73,7 @@ void loop() { if (millis() - lastGNSSsend > 200) { - myGPS.checkUblox(); //See if new data is available, but we don't want to get NMEA here. Go check UART1. + myGNSS.checkUblox(); //See if new data is available, but we don't want to get NMEA here. Go check UART1. lastGNSSsend = millis(); } } diff --git a/examples/Example7_OutputRate/Example7_OutputRate.ino b/examples/Example7_OutputRate/Example7_OutputRate.ino index 9550ac0..598b096 100644 --- a/examples/Example7_OutputRate/Example7_OutputRate.ino +++ b/examples/Example7_OutputRate/Example7_OutputRate.ino @@ -30,7 +30,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; unsigned long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. unsigned long startTime = 0; //Used to calc the actual update rate. @@ -48,16 +48,16 @@ void setup() // (We normally recommend running the bus at 100kHz) Wire.setClock(400000); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.setNavigationFrequency(5); //Set output to 5 times a second + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setNavigationFrequency(5); //Set output to 5 times a second - uint8_t rate = myGPS.getNavigationFrequency(); //Get the update rate of this module + uint8_t rate = myGNSS.getNavigationFrequency(); //Get the update rate of this module Serial.print("Current update rate: "); Serial.println(rate); @@ -73,11 +73,11 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); diff --git a/examples/Example8_GetProtocolVersion/Example8_GetProtocolVersion.ino b/examples/Example8_GetProtocolVersion/Example8_GetProtocolVersion.ino index b5d70a5..677fda4 100644 --- a/examples/Example8_GetProtocolVersion/Example8_GetProtocolVersion.ino +++ b/examples/Example8_GetProtocolVersion/Example8_GetProtocolVersion.ino @@ -29,7 +29,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -41,17 +41,17 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } Serial.print(F("Version: ")); - byte versionHigh = myGPS.getProtocolVersionHigh(); + byte versionHigh = myGNSS.getProtocolVersionHigh(); Serial.print(versionHigh); Serial.print("."); - byte versionLow = myGPS.getProtocolVersionLow(); + byte versionLow = myGNSS.getProtocolVersionLow(); Serial.print(versionLow); } diff --git a/examples/Example8_GetProtocolVersion_Serial/Example8_GetProtocolVersion_Serial.ino b/examples/Example8_GetProtocolVersion_Serial/Example8_GetProtocolVersion_Serial.ino index 3c13902..4f3d7c5 100644 --- a/examples/Example8_GetProtocolVersion_Serial/Example8_GetProtocolVersion_Serial.ino +++ b/examples/Example8_GetProtocolVersion_Serial/Example8_GetProtocolVersion_Serial.ino @@ -36,7 +36,7 @@ //SoftwareSerial mySerial(10, 11); // Uncomment this line to connect via SoftwareSerial(RX, TX). Connect pin 10 to GNSS TX pin. #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -48,7 +48,7 @@ void setup() Serial.println("Trying 38400 baud"); mySerial.begin(38400); - if (myGPS.begin(mySerial)) + if (myGNSS.begin(mySerial)) { Serial.println("GNSS connected at 38400 baud"); } @@ -56,7 +56,7 @@ void setup() { Serial.println("Trying 9600 baud"); mySerial.begin(9600); - if (myGPS.begin(mySerial)) + if (myGNSS.begin(mySerial)) { Serial.println("GNSS connected at 9600 baud"); } @@ -68,10 +68,10 @@ void setup() } Serial.print(F("Version: ")); - byte versionHigh = myGPS.getProtocolVersionHigh(); + byte versionHigh = myGNSS.getProtocolVersionHigh(); Serial.print(versionHigh); Serial.print("."); - byte versionLow = myGPS.getProtocolVersionLow(); + byte versionLow = myGNSS.getProtocolVersionLow(); Serial.print(versionLow); } diff --git a/examples/Example9_ChangeI2CAddress/Example9_ChangeI2CAddress.ino b/examples/Example9_ChangeI2CAddress/Example9_ChangeI2CAddress.ino index 61a3cd5..42ca7ee 100644 --- a/examples/Example9_ChangeI2CAddress/Example9_ChangeI2CAddress.ino +++ b/examples/Example9_ChangeI2CAddress/Example9_ChangeI2CAddress.ino @@ -23,7 +23,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Tracks the passing of 2000ms (2 seconds) @@ -43,21 +43,21 @@ void setup() Serial.println(newAddress, HEX); while (Serial.available() == false) ; //Wait for user to send character - //myGPS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial + //myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial - if (myGPS.begin(Wire, oldAddress) == true) //Connect to the u-blox module using Wire port and the old address + if (myGNSS.begin(Wire, oldAddress) == true) //Connect to the u-blox module using Wire port and the old address { Serial.print("GNSS found at address 0x"); Serial.println(oldAddress, HEX); - myGPS.setI2CAddress(newAddress); //Change I2C address of this device + myGNSS.setI2CAddress(newAddress); //Change I2C address of this device //Device's I2C address is stored to memory and loaded on each power-on delay(2000); // Allow time for the change to take - if (myGPS.begin(Wire, newAddress) == true) + if (myGNSS.begin(Wire, newAddress) == true) { - myGPS.saveConfiguration(); //Save the current settings to flash and BBR + myGNSS.saveConfiguration(); //Save the current settings to flash and BBR Serial.print("Address successfully changed to 0x"); Serial.println(newAddress, HEX); diff --git a/examples/NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino b/examples/NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino index 308b434..f0daf76 100644 --- a/examples/NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino +++ b/examples/NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino @@ -25,7 +25,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -36,7 +36,7 @@ void setup() Wire.begin(); Wire.setClock(400000); //Increase I2C clock speed to 400kHz - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); @@ -46,14 +46,14 @@ void setup() Serial.println(F("Press any key to send commands to enable RTCM 3.x")); while(Serial.available() == 0) ; //Wait for user to press a key - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfiguration(); //Save the current settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfiguration(); //Save the current settings to flash and BBR boolean response = true; - response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second - response &= myGPS.enableRTCMmessage(UBX_RTCM_1077, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1087, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1077, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1087, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds if (response == true) { @@ -71,7 +71,7 @@ void setup() void loop() { - myGPS.checkUblox(); //See if new data is available. Process bytes as they come in. + myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in. delay(250); //Don't pound too hard on the I2C bus } diff --git a/examples/NEO-M8P-2/Example2_StartRTCMBase/Example2_StartRTCMBase.ino b/examples/NEO-M8P-2/Example2_StartRTCMBase/Example2_StartRTCMBase.ino index bdccc45..791ed32 100644 --- a/examples/NEO-M8P-2/Example2_StartRTCMBase/Example2_StartRTCMBase.ino +++ b/examples/NEO-M8P-2/Example2_StartRTCMBase/Example2_StartRTCMBase.ino @@ -29,7 +29,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -40,14 +40,14 @@ void setup() Wire.begin(); Wire.setClock(400000); //Increase I2C clock speed to 400kHz - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfiguration(); //Save the current settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfiguration(); //Save the current settings to flash and BBR while (Serial.available()) Serial.read(); //Clear any latent chars in serial buffer Serial.println(F("Press any key to send commands to begin Survey-In")); @@ -60,7 +60,7 @@ void setup() // Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t // You can either read the data from packetUBXNAVSVIN directly // or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; and getSurveyInMeanAccuracy - response = myGPS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (request can take a long time) + response = myGNSS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (request can take a long time) if (response == false) // Check if fresh data was received { @@ -68,14 +68,14 @@ void setup() while (1); //Freeze } - if (myGPS.getSurveyInActive() == true) // Use the helper function + if (myGNSS.getSurveyInActive() == true) // Use the helper function { Serial.print(F("Survey already in progress.")); } else { //Start survey - response = myGPS.enableSurveyMode(300, 2.000); //Enable Survey in, 300 seconds, 2.0m + response = myGNSS.enableSurveyMode(300, 2.000); //Enable Survey in, 300 seconds, 2.0m if (response == false) { Serial.println(F("Survey start failed. Freezing...")); @@ -87,7 +87,7 @@ void setup() while(Serial.available()) Serial.read(); //Clear buffer //Begin waiting for survey to complete - while (myGPS.getSurveyInValid() == false) // Call the helper function + while (myGNSS.getSurveyInValid() == false) // Call the helper function { if(Serial.available()) { @@ -95,7 +95,7 @@ void setup() if(incoming == 'x') { //Stop survey mode - response = myGPS.disableSurveyMode(); //Disable survey + response = myGNSS.disableSurveyMode(); //Disable survey Serial.println(F("Survey stopped")); break; } @@ -105,15 +105,15 @@ void setup() // Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t // You can either read the data from packetUBXNAVSVIN directly // or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; and getSurveyInMeanAccuracy - response = myGPS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (req can take a long time) + response = myGNSS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (req can take a long time) if (response == true) // Check if fresh data was received { Serial.print(F("Press x to end survey - ")); Serial.print(F("Time elapsed: ")); - Serial.print((String)myGPS.getSurveyInObservationTime()); + Serial.print((String)myGNSS.getSurveyInObservationTime()); Serial.print(F(" Accuracy: ")); - Serial.print((String)myGPS.getSurveyInMeanAccuracy()); + Serial.print((String)myGNSS.getSurveyInMeanAccuracy()); Serial.println(); } else @@ -126,10 +126,10 @@ void setup() Serial.println(F("Survey valid!")); response = true; - response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second - response &= myGPS.enableRTCMmessage(UBX_RTCM_1077, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1087, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1077, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1087, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds if (response == true) { @@ -146,7 +146,7 @@ void setup() void loop() { - myGPS.checkUblox(); //See if new data is available. Process bytes as they come in. + myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in. delay(250); //Don't pound too hard on the I2C bus } @@ -154,10 +154,10 @@ void loop() //This function gets called from the SparkFun u-blox Arduino Library. //As each RTCM byte comes in you can specify what to do with it //Useful for passing the RTCM correction data to a radio, Ntrip broadcaster, etc. -void SFE_UBLOX_GPS::processRTCM(uint8_t incoming) +void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming) { //Let's just pretty-print the HEX values for now - if (myGPS.rtcmFrameCounter % 16 == 0) Serial.println(); + if (myGNSS.rtcmFrameCounter % 16 == 0) Serial.println(); Serial.print(F(" ")); if (incoming < 0x10) Serial.print(F("0")); Serial.print(incoming, HEX); diff --git a/examples/NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino b/examples/NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino index 2eb9598..c49f954 100644 --- a/examples/NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino +++ b/examples/NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino @@ -32,7 +32,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; #include //Click here to get the library: http://librarymanager/All#SparkFun_SerLCD SerLCD lcd; // Initialize the library with default I2C address 0x72 @@ -53,8 +53,8 @@ void setup() lcd.clear(); lcd.print(F("LCD Ready")); - myGPS.begin(Wire); - if (myGPS.isConnected() == false) + myGNSS.begin(Wire); + if (myGNSS.isConnected() == false) { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); lcd.setCursor(0, 1); @@ -73,14 +73,14 @@ void setup() // You can either read the data from packetUBXNAVSVIN directly // or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; and getSurveyInMeanAccuracy boolean response; - response = myGPS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (request can take a long time) + response = myGNSS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (request can take a long time) if (response == false) { Serial.println(F("Failed to get Survey In status")); while (1); //Freeze } - if (myGPS.getSurveyInActive() == true) // Use the helper function + if (myGNSS.getSurveyInActive() == true) // Use the helper function { Serial.print(F("Survey already in progress.")); lcd.setCursor(0, 2); @@ -89,7 +89,7 @@ void setup() else { //Start survey - response = myGPS.enableSurveyMode(300, 2.000); //Enable Survey in, 300 seconds, 2.0m + response = myGNSS.enableSurveyMode(300, 2.000); //Enable Survey in, 300 seconds, 2.0m if (response == false) { Serial.println(F("Survey start failed")); @@ -106,7 +106,7 @@ void setup() lcd.print(F("Survey in progress")); //Begin waiting for survey to complete - while (myGPS.getSurveyInValid() == false) // Call the helper function + while (myGNSS.getSurveyInValid() == false) // Call the helper function { if (Serial.available()) { @@ -114,7 +114,7 @@ void setup() if (incoming == 'x') { //Stop survey mode - response = myGPS.disableSurveyMode(); //Disable survey + response = myGNSS.disableSurveyMode(); //Disable survey Serial.println(F("Survey stopped")); break; } @@ -124,24 +124,24 @@ void setup() // Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t // You can either read the data from packetUBXNAVSVIN directly // or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; and getSurveyInMeanAccuracy - response = myGPS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (req can take a long time) + response = myGNSS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (req can take a long time) if (response == true) { Serial.print(F("Press x to end survey - ")); Serial.print(F("Time elapsed: ")); - Serial.print((String)myGPS.getSurveyInObservationTime()); + Serial.print((String)myGNSS.getSurveyInObservationTime()); lcd.setCursor(0, 1); lcd.print(F("Elapsed: ")); - lcd.print((String)myGPS.getSurveyInObservationTime()); + lcd.print((String)myGNSS.getSurveyInObservationTime()); Serial.print(F(" Accuracy: ")); - Serial.print((String)myGPS.getSurveyInMeanAccuracy()); + Serial.print((String)myGNSS.getSurveyInMeanAccuracy()); Serial.println(); lcd.setCursor(0, 2); lcd.print(F("Accuracy: ")); - lcd.print((String)myGPS.getSurveyInMeanAccuracy()); + lcd.print((String)myGNSS.getSurveyInMeanAccuracy()); } else { @@ -153,10 +153,10 @@ void setup() Serial.println(F("Survey valid!")); response = true; - response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second - response &= myGPS.enableRTCMmessage(UBX_RTCM_1077, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1087, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1077, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1087, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds if (response == true) { @@ -175,7 +175,7 @@ void setup() void loop() { - myGPS.checkUblox(); //See if new data is available. Process bytes as they come in. + myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in. //Do anything you want. Call checkUblox() every second. NEO-M8P-2 has TX buffer of 4k bytes. @@ -185,10 +185,10 @@ void loop() //This function gets called from the SparkFun u-blox Arduino Library. //As each RTCM byte comes in you can specify what to do with it //Useful for passing the RTCM correction data to a radio, Ntrip broadcaster, etc. -void SFE_UBLOX_GPS::processRTCM(uint8_t incoming) +void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming) { //Let's just pretty-print the HEX values for now - if (myGPS.rtcmFrameCounter % 16 == 0) Serial.println(); + if (myGNSS.rtcmFrameCounter % 16 == 0) Serial.println(); Serial.print(" "); if (incoming < 0x10) Serial.print("0"); Serial.print(incoming, HEX); diff --git a/examples/ZED-F9P/Example10_GetHighPrecisionPositionAndAccuracy/Example10_GetHighPrecisionPositionAndAccuracy.ino b/examples/ZED-F9P/Example10_GetHighPrecisionPositionAndAccuracy/Example10_GetHighPrecisionPositionAndAccuracy.ino index 2cf277a..69c5d43 100644 --- a/examples/ZED-F9P/Example10_GetHighPrecisionPositionAndAccuracy/Example10_GetHighPrecisionPositionAndAccuracy.ino +++ b/examples/ZED-F9P/Example10_GetHighPrecisionPositionAndAccuracy/Example10_GetHighPrecisionPositionAndAccuracy.ino @@ -24,7 +24,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -35,22 +35,22 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(Serial); + //myGNSS.enableDebugging(Serial); - if (myGPS.begin(Wire) == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin(Wire) == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.setNavigationFrequency(20); //Set output to 20 times a second + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setNavigationFrequency(20); //Set output to 20 times a second - byte rate = myGPS.getNavigationFrequency(); //Get the update rate of this module + byte rate = myGNSS.getNavigationFrequency(); //Get the update rate of this module Serial.print("Current update rate: "); Serial.println(rate); - //myGPS.saveConfiguration(); //Save the current settings to flash and BBR + //myGNSS.saveConfiguration(); //Save the current settings to flash and BBR } void loop() @@ -79,15 +79,15 @@ void loop() // The high resolution altitudes can be converted into standard 32-bit float // First, let's collect the position data - int32_t latitude = myGPS.getHighResLatitude(); - int8_t latitudeHp = myGPS.getHighResLatitudeHp(); - int32_t longitude = myGPS.getHighResLongitude(); - int8_t longitudeHp = myGPS.getHighResLongitudeHp(); - int32_t ellipsoid = myGPS.getElipsoid(); - int8_t ellipsoidHp = myGPS.getElipsoidHp(); - int32_t msl = myGPS.getMeanSeaLevel(); - int8_t mslHp = myGPS.getMeanSeaLevelHp(); - uint32_t accuracy = myGPS.getHorizontalAccuracy(); + int32_t latitude = myGNSS.getHighResLatitude(); + int8_t latitudeHp = myGNSS.getHighResLatitudeHp(); + int32_t longitude = myGNSS.getHighResLongitude(); + int8_t longitudeHp = myGNSS.getHighResLongitudeHp(); + int32_t ellipsoid = myGNSS.getElipsoid(); + int8_t ellipsoidHp = myGNSS.getElipsoidHp(); + int32_t msl = myGNSS.getMeanSeaLevel(); + int8_t mslHp = myGNSS.getMeanSeaLevelHp(); + uint32_t accuracy = myGNSS.getHorizontalAccuracy(); // Defines storage for the lat and lon units integer and fractional parts int32_t lat_int; // Integer part of the latitude in degrees diff --git a/examples/ZED-F9P/Example11_GetHighPrecisionPositionUsingDouble/Example11_GetHighPrecisionPositionUsingDouble.ino b/examples/ZED-F9P/Example11_GetHighPrecisionPositionUsingDouble/Example11_GetHighPrecisionPositionUsingDouble.ino index 58eb295..5f50e89 100644 --- a/examples/ZED-F9P/Example11_GetHighPrecisionPositionUsingDouble/Example11_GetHighPrecisionPositionUsingDouble.ino +++ b/examples/ZED-F9P/Example11_GetHighPrecisionPositionUsingDouble/Example11_GetHighPrecisionPositionUsingDouble.ino @@ -30,7 +30,7 @@ //#define myWire Wire1 // Uncomment this line if you are using the extra SCL1/SDA1 pins (D17 and D16) on the Thing Plus #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -41,9 +41,9 @@ void setup() myWire.begin(); - //myGPS.enableDebugging(Serial); // Uncomment this line to enable debug messages + //myGNSS.enableDebugging(Serial); // Uncomment this line to enable debug messages - if (myGPS.begin(myWire) == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin(myWire) == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) @@ -57,15 +57,15 @@ void setup() Serial.println(F("The latitude and longitude will be inaccurate.")); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - //myGPS.setNavigationFrequency(20); //Set output to 20 times a second + //myGNSS.setNavigationFrequency(20); //Set output to 20 times a second - byte rate = myGPS.getNavigationFrequency(); //Get the update rate of this module + byte rate = myGNSS.getNavigationFrequency(); //Get the update rate of this module Serial.print("Current update rate: "); Serial.println(rate); - //myGPS.saveConfiguration(); //Save the current settings to flash and BBR + //myGNSS.saveConfiguration(); //Save the current settings to flash and BBR } void loop() @@ -87,15 +87,15 @@ void loop() // getHorizontalAccuracy: returns the horizontal accuracy estimate from HPPOSLLH as an uint32_t in mm * 10^-1 // First, let's collect the position data - int32_t latitude = myGPS.getHighResLatitude(); - int8_t latitudeHp = myGPS.getHighResLatitudeHp(); - int32_t longitude = myGPS.getHighResLongitude(); - int8_t longitudeHp = myGPS.getHighResLongitudeHp(); - int32_t ellipsoid = myGPS.getElipsoid(); - int8_t ellipsoidHp = myGPS.getElipsoidHp(); - int32_t msl = myGPS.getMeanSeaLevel(); - int8_t mslHp = myGPS.getMeanSeaLevelHp(); - uint32_t accuracy = myGPS.getHorizontalAccuracy(); + int32_t latitude = myGNSS.getHighResLatitude(); + int8_t latitudeHp = myGNSS.getHighResLatitudeHp(); + int32_t longitude = myGNSS.getHighResLongitude(); + int8_t longitudeHp = myGNSS.getHighResLongitudeHp(); + int32_t ellipsoid = myGNSS.getElipsoid(); + int8_t ellipsoidHp = myGNSS.getElipsoidHp(); + int32_t msl = myGNSS.getMeanSeaLevel(); + int8_t mslHp = myGNSS.getMeanSeaLevelHp(); + uint32_t accuracy = myGNSS.getHorizontalAccuracy(); // Defines storage for the lat and lon as double double d_lat; // latitude diff --git a/examples/ZED-F9P/Example12_setStaticPosition/Example12_setStaticPosition.ino b/examples/ZED-F9P/Example12_setStaticPosition/Example12_setStaticPosition.ino index 12ed29d..bb4bb2c 100644 --- a/examples/ZED-F9P/Example12_setStaticPosition/Example12_setStaticPosition.ino +++ b/examples/ZED-F9P/Example12_setStaticPosition/Example12_setStaticPosition.ino @@ -25,7 +25,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -36,36 +36,36 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) boolean success = true; //-1280208.308,-4716803.847,4086665.811 is SparkFun HQ so... //Units are cm so 1234 = 12.34m - //success &= myGPS.setStaticPosition(-128020831, -471680385, 408666581); + //success &= myGNSS.setStaticPosition(-128020831, -471680385, 408666581); //Units are cm with a high precision extension so -1234.5678 should be called: (-123456, -78) - success &= myGPS.setStaticPosition(-128020830, -80, -471680384, -70, 408666581, 10); //With high precision 0.1mm parts + success &= myGNSS.setStaticPosition(-128020830, -80, -471680384, -70, 408666581, 10); //With high precision 0.1mm parts //We can also set via lat/long //40.09029751,-105.18507900,1560.238 - //success &= myGPS.setStaticPosition(400902975, -1051850790, 156024, true); //True at end enables lat/long input - //success &= myGPS.setStaticPosition(400902975, 10, -1051850790, 0, 156023, 80, true); + //success &= myGNSS.setStaticPosition(400902975, -1051850790, 156024, true); //True at end enables lat/long input + //success &= myGNSS.setStaticPosition(400902975, 10, -1051850790, 0, 156023, 80, true); if (!success) Serial.println(F("At least one call to setStaticPosition failed!")); //Now let's use getVals to read back the data - //long ecefX = myGPS.getVal32(0x40030003); + //long ecefX = myGNSS.getVal32(0x40030003); //Serial.print("ecefX: "); //Serial.println(ecefX); diff --git a/examples/ZED-F9P/Example13_autoHPPOSLLH/Example13_autoHPPOSLLH.ino b/examples/ZED-F9P/Example13_autoHPPOSLLH/Example13_autoHPPOSLLH.ino index c56eeba..ca7d7a2 100644 --- a/examples/ZED-F9P/Example13_autoHPPOSLLH/Example13_autoHPPOSLLH.ino +++ b/examples/ZED-F9P/Example13_autoHPPOSLLH/Example13_autoHPPOSLLH.ino @@ -31,8 +31,8 @@ #include //Needed for I2C to GNSS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -42,72 +42,72 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable lots of helpful debug messages - //myGPS.enableDebugging(Serial, true); // Uncomment this line to enable the minimum of helpful debug messages + //myGNSS.enableDebugging(); // Uncomment this line to enable lots of helpful debug messages + //myGNSS.enableDebugging(Serial, true); // Uncomment this line to enable the minimum of helpful debug messages - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate - //myGPS.factoryDefault(); delay(5000); + //myGNSS.factoryDefault(); delay(5000); - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR - myGPS.setNavigationFrequency(1); //Produce one solution per second + myGNSS.setNavigationFrequency(1); //Produce one solution per second // The acid test: all four of these combinations should work seamlessly :-) - //myGPS.setAutoPVT(false); // Library will poll each reading - //myGPS.setAutoHPPOSLLH(false); // Library will poll each reading + //myGNSS.setAutoPVT(false); // Library will poll each reading + //myGNSS.setAutoHPPOSLLH(false); // Library will poll each reading - //myGPS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically - //myGPS.setAutoHPPOSLLH(false); // Library will poll each reading + //myGNSS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically + //myGNSS.setAutoHPPOSLLH(false); // Library will poll each reading - //myGPS.setAutoPVT(false); // Library will poll each reading - //myGPS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically + //myGNSS.setAutoPVT(false); // Library will poll each reading + //myGNSS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically - myGPS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically - myGPS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically + myGNSS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically + myGNSS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically } void loop() { // Calling getHPPOSLLH returns true if there actually is a fresh navigation solution available. // Calling getPVT returns true if there actually is a fresh navigation solution available. - if ((myGPS.getHPPOSLLH()) || (myGPS.getPVT())) + if ((myGNSS.getHPPOSLLH()) || (myGNSS.getPVT())) { Serial.println(); - long highResLatitude = myGPS.getHighResLatitude(); + long highResLatitude = myGNSS.getHighResLatitude(); Serial.print(F("Hi Res Lat: ")); Serial.print(highResLatitude); - int highResLatitudeHp = myGPS.getHighResLatitudeHp(); + int highResLatitudeHp = myGNSS.getHighResLatitudeHp(); Serial.print(F(" ")); Serial.print(highResLatitudeHp); - long highResLongitude = myGPS.getHighResLongitude(); + long highResLongitude = myGNSS.getHighResLongitude(); Serial.print(F(" Hi Res Long: ")); Serial.print(highResLongitude); - int highResLongitudeHp = myGPS.getHighResLongitudeHp(); + int highResLongitudeHp = myGNSS.getHighResLongitudeHp(); Serial.print(F(" ")); Serial.print(highResLongitudeHp); - unsigned long horizAccuracy = myGPS.getHorizontalAccuracy(); + unsigned long horizAccuracy = myGNSS.getHorizontalAccuracy(); Serial.print(F(" Horiz accuracy: ")); Serial.print(horizAccuracy); - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F(" Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.println(longitude); } diff --git a/examples/ZED-F9P/Example13_autoHPPOSLLH_with_Callback/Example13_autoHPPOSLLH_with_Callback.ino b/examples/ZED-F9P/Example13_autoHPPOSLLH_with_Callback/Example13_autoHPPOSLLH_with_Callback.ino index 89611b7..08c2a75 100644 --- a/examples/ZED-F9P/Example13_autoHPPOSLLH_with_Callback/Example13_autoHPPOSLLH_with_Callback.ino +++ b/examples/ZED-F9P/Example13_autoHPPOSLLH_with_Callback/Example13_autoHPPOSLLH_with_Callback.ino @@ -31,8 +31,8 @@ #include //Needed for I2C to GNSS -#include //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +#include //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; // Callback: printHPdata will be called when new NAV HPPOSLLH data arrives // See u-blox_structs.h for the full definition of UBX_NAV_HPPOSLLH_data_t @@ -118,32 +118,32 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable lots of helpful debug messages - //myGPS.enableDebugging(Serial, true); // Uncomment this line to enable the minimum of helpful debug messages + //myGNSS.enableDebugging(); // Uncomment this line to enable lots of helpful debug messages + //myGNSS.enableDebugging(Serial, true); // Uncomment this line to enable the minimum of helpful debug messages - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate - //myGPS.factoryDefault(); delay(5000); + //myGNSS.factoryDefault(); delay(5000); - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR - myGPS.setNavigationFrequency(2); //Produce two solutions per second + myGNSS.setNavigationFrequency(2); //Produce two solutions per second - myGPS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata + myGNSS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata - myGPS.setAutoHPPOSLLHcallback(&printHPdata); // Enable automatic NAV HPPOSLLH messages with callback to printHPdata + myGNSS.setAutoHPPOSLLHcallback(&printHPdata); // Enable automatic NAV HPPOSLLH messages with callback to printHPdata } void loop() { - myGPS.checkUblox(); // Check for the arrival of new data and process it. You could set up a timer interrupt to do this for you. - myGPS.checkCallbacks(); // Check if any callbacks are waiting to be processed. + myGNSS.checkUblox(); // Check for the arrival of new data and process it. You could set up a timer interrupt to do this for you. + myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed. Serial.print("."); delay(50); diff --git a/examples/ZED-F9P/Example14_NTRIPServer/Example14_NTRIPServer.ino b/examples/ZED-F9P/Example14_NTRIPServer/Example14_NTRIPServer.ino index 13ae4ae..3d95ce6 100644 --- a/examples/ZED-F9P/Example14_NTRIPServer/Example14_NTRIPServer.ino +++ b/examples/ZED-F9P/Example14_NTRIPServer/Example14_NTRIPServer.ino @@ -37,7 +37,7 @@ WiFiClient client; #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; //Basic Connection settings to RTK2Go NTRIP Caster - See secrets for mount specific credentials //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -62,9 +62,9 @@ void setup() Wire.begin(); - //myGPS.enableDebugging(); // Uncomment this line to enable debug messages + //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) @@ -81,19 +81,19 @@ void setup() Serial.print("\nWiFi connected with IP: "); Serial.println(WiFi.localIP()); - myGPS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); //UBX+RTCM3 is not a valid option so we enable all three. + myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); //UBX+RTCM3 is not a valid option so we enable all three. - myGPS.setNavigationFrequency(1); //Set output in Hz. RTCM rarely benefits from >1Hz. + myGNSS.setNavigationFrequency(1); //Set output in Hz. RTCM rarely benefits from >1Hz. //Disable all NMEA sentences bool response = true; - response &= myGPS.disableNMEAMessage(UBX_NMEA_GGA, COM_PORT_I2C); - response &= myGPS.disableNMEAMessage(UBX_NMEA_GSA, COM_PORT_I2C); - response &= myGPS.disableNMEAMessage(UBX_NMEA_GSV, COM_PORT_I2C); - response &= myGPS.disableNMEAMessage(UBX_NMEA_RMC, COM_PORT_I2C); - response &= myGPS.disableNMEAMessage(UBX_NMEA_GST, COM_PORT_I2C); - response &= myGPS.disableNMEAMessage(UBX_NMEA_GLL, COM_PORT_I2C); - response &= myGPS.disableNMEAMessage(UBX_NMEA_VTG, COM_PORT_I2C); + response &= myGNSS.disableNMEAMessage(UBX_NMEA_GGA, COM_PORT_I2C); + response &= myGNSS.disableNMEAMessage(UBX_NMEA_GSA, COM_PORT_I2C); + response &= myGNSS.disableNMEAMessage(UBX_NMEA_GSV, COM_PORT_I2C); + response &= myGNSS.disableNMEAMessage(UBX_NMEA_RMC, COM_PORT_I2C); + response &= myGNSS.disableNMEAMessage(UBX_NMEA_GST, COM_PORT_I2C); + response &= myGNSS.disableNMEAMessage(UBX_NMEA_GLL, COM_PORT_I2C); + response &= myGNSS.disableNMEAMessage(UBX_NMEA_VTG, COM_PORT_I2C); if (response == false) { @@ -104,12 +104,12 @@ void setup() Serial.println(F("NMEA disabled")); //Enable necessary RTCM sentences - response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through UART2, message every second - response &= myGPS.enableRTCMmessage(UBX_RTCM_1074, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1084, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1094, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1124, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through UART2, message every second + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1074, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1084, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1094, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1124, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds if (response == false) { @@ -125,7 +125,7 @@ void setup() //Note: If you leave these coordinates in place and setup your antenna *not* at SparkFun, your receiver //will be very confused and fail to generate correction data because, well, you aren't at SparkFun... //See this tutorial on getting PPP coordinates: https://learn.sparkfun.com/tutorials/how-to-build-a-diy-gnss-reference-station/all - response &= myGPS.setStaticPosition(-128020830, -80, -471680384, -70, 408666581, 10); //With high precision 0.1mm parts + response &= myGNSS.setStaticPosition(-128020830, -80, -471680384, -70, 408666581, 10); //With high precision 0.1mm parts if (response == false) { Serial.println(F("Failed to enter static position. Freezing...")); @@ -135,9 +135,9 @@ void setup() Serial.println(F("Static position set")); //You could instead do a survey-in but it takes much longer to start generating RTCM data. See Example4_BaseWithLCD - //myGPS.enableSurveyMode(60, 5.000); //Enable Survey in, 60 seconds, 5.0m + //myGNSS.enableSurveyMode(60, 5.000); //Enable Survey in, 60 seconds, 5.0m - if (myGPS.saveConfiguration() == false) //Save the current settings to flash and BBR + if (myGNSS.saveConfiguration() == false) //Save the current settings to flash and BBR Serial.println(F("Module failed to save.")); Serial.println(F("Module configuration complete")); @@ -228,7 +228,7 @@ void beginServing() { if (Serial.available()) break; - myGPS.checkUblox(); //See if new data is available. Process bytes as they come in. + myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in. //Close socket if we don't have new data for 10s //RTK2Go will ban your IP address if you abuse it. See http://www.rtk2go.com/how-to-get-your-ip-banned/ @@ -265,7 +265,7 @@ void beginServing() //This function gets called from the SparkFun u-blox Arduino Library. //As each RTCM byte comes in you can specify what to do with it //Useful for passing the RTCM correction data to a radio, Ntrip broadcaster, etc. -void SFE_UBLOX_GPS::processRTCM(uint8_t incoming) +void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming) { if (client.connected() == true) { diff --git a/examples/ZED-F9P/Example1_GetPositionAccuracy/Example1_GetPositionAccuracy.ino b/examples/ZED-F9P/Example1_GetPositionAccuracy/Example1_GetPositionAccuracy.ino index 54a7f04..c5cd4c1 100644 --- a/examples/ZED-F9P/Example1_GetPositionAccuracy/Example1_GetPositionAccuracy.ino +++ b/examples/ZED-F9P/Example1_GetPositionAccuracy/Example1_GetPositionAccuracy.ino @@ -24,7 +24,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -36,14 +36,14 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - //myGPS.saveConfiguration(); //Optional: Save the current settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + //myGNSS.saveConfiguration(); //Optional: Save the current settings to flash and BBR } void loop() @@ -54,21 +54,21 @@ void loop() { lastTime = millis(); //Update the timer - long latitude = myGPS.getLatitude(); + long latitude = myGNSS.getLatitude(); Serial.print(F("Lat: ")); Serial.print(latitude); - long longitude = myGPS.getLongitude(); + long longitude = myGNSS.getLongitude(); Serial.print(F(" Long: ")); Serial.print(longitude); Serial.print(F(" (degrees * 10^-7)")); - long altitude = myGPS.getAltitude(); + long altitude = myGNSS.getAltitude(); Serial.print(F(" Alt: ")); Serial.print(altitude); Serial.print(F(" (mm)")); - long accuracy = myGPS.getPositionAccuracy(); + long accuracy = myGNSS.getPositionAccuracy(); Serial.print(F(" 3D Positional Accuracy: ")); Serial.print(accuracy); Serial.println(F(" (mm)")); diff --git a/examples/ZED-F9P/Example2_ValConfigurationMethod/Example2_ValConfigurationMethod.ino b/examples/ZED-F9P/Example2_ValConfigurationMethod/Example2_ValConfigurationMethod.ino index d388d15..11f7779 100644 --- a/examples/ZED-F9P/Example2_ValConfigurationMethod/Example2_ValConfigurationMethod.ino +++ b/examples/ZED-F9P/Example2_ValConfigurationMethod/Example2_ValConfigurationMethod.ino @@ -30,7 +30,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -42,18 +42,18 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } byte response; - response = myGPS.getVal8(UBLOX_CFG_I2C_ADDRESS, VAL_LAYER_RAM); // Get the I2C address (see u-blox_config_keys.h for details) + response = myGNSS.getVal8(UBLOX_CFG_I2C_ADDRESS, VAL_LAYER_RAM); // Get the I2C address (see u-blox_config_keys.h for details) Serial.print(F("I2C Address: 0x")); Serial.println(response >> 1, HEX); //We have to shift by 1 to get the common '7-bit' I2C address format - response = myGPS.getVal8(UBLOX_CFG_I2COUTPROT_NMEA, VAL_LAYER_RAM); // Get the flag indicating is NMEA should be output on I2C + response = myGNSS.getVal8(UBLOX_CFG_I2COUTPROT_NMEA, VAL_LAYER_RAM); // Get the flag indicating is NMEA should be output on I2C Serial.print(F("Output NMEA over I2C port: 0x")); Serial.print(response, HEX); } diff --git a/examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino b/examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino index e9cf1b9..91f691d 100644 --- a/examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino +++ b/examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino @@ -27,7 +27,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; //#define USE_SERIAL1 // Uncomment this line to push the RTCM data to Serial1 @@ -45,33 +45,33 @@ void setup() Wire.begin(); Wire.setClock(400000); //Increase I2C clock speed to 400kHz - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate - //myGPS.factoryDefault(); delay(5000); + //myGNSS.factoryDefault(); delay(5000); - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR while (Serial.available()) Serial.read(); //Clear any latent chars in serial buffer Serial.println(F("Press any key to send commands to begin Survey-In")); while (Serial.available() == 0) ; //Wait for user to press a key boolean response = true; - response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second - response &= myGPS.enableRTCMmessage(UBX_RTCM_1074, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1084, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1094, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1124, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1074, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1084, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1094, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1124, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds //Use COM_PORT_UART1 for the above six messages to direct RTCM messages out UART1 //COM_PORT_UART2, COM_PORT_USB, COM_PORT_SPI are also available - //For example: response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_UART1, 10); + //For example: response &= myGNSS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_UART1, 10); if (response == true) { @@ -88,7 +88,7 @@ void setup() // Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t // You can either read the data from packetUBXNAVSVIN directly // or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; and getSurveyInMeanAccuracy - response = myGPS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (request can take a long time) + response = myGNSS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (request can take a long time) if (response == false) // Check if fresh data was received { @@ -96,8 +96,8 @@ void setup() while (1); //Freeze } - if (myGPS.getSurveyInActive() == true) // Use the helper function - //if (myGPS.packetUBXNAVSVIN->data.active > 0) // Or we could read active directly + if (myGNSS.getSurveyInActive() == true) // Use the helper function + //if (myGNSS.packetUBXNAVSVIN->data.active > 0) // Or we could read active directly { Serial.print(F("Survey already in progress.")); } @@ -105,8 +105,8 @@ void setup() { //Start survey //The ZED-F9P is slightly different than the NEO-M8P. See the Integration manual 3.5.8 for more info. - //response = myGPS.enableSurveyMode(300, 2.000); //Enable Survey in on NEO-M8P, 300 seconds, 2.0m - response = myGPS.enableSurveyMode(60, 5.000); //Enable Survey in, 60 seconds, 5.0m + //response = myGNSS.enableSurveyMode(300, 2.000); //Enable Survey in on NEO-M8P, 300 seconds, 2.0m + response = myGNSS.enableSurveyMode(60, 5.000); //Enable Survey in, 60 seconds, 5.0m if (response == false) { Serial.println(F("Survey start failed. Freezing...")); @@ -118,8 +118,8 @@ void setup() while(Serial.available()) Serial.read(); //Clear buffer //Begin waiting for survey to complete - while (myGPS.getSurveyInValid() == false) // Call the helper function - //while (myGPS.packetUBXNAVSVIN->data.valid == 0) // Or we could read valid directly + while (myGNSS.getSurveyInValid() == false) // Call the helper function + //while (myGNSS.packetUBXNAVSVIN->data.valid == 0) // Or we could read valid directly { if(Serial.available()) { @@ -127,7 +127,7 @@ void setup() if(incoming == 'x') { //Stop survey mode - response = myGPS.disableSurveyMode(); //Disable survey + response = myGNSS.disableSurveyMode(); //Disable survey Serial.println(F("Survey stopped")); break; } @@ -137,21 +137,21 @@ void setup() // Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t // You can either read the data from packetUBXNAVSVIN directly // or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; and getSurveyInMeanAccuracy - response = myGPS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (req can take a long time) + response = myGNSS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (req can take a long time) if (response == true) // Check if fresh data was received { Serial.print(F("Press x to end survey - ")); Serial.print(F("Time elapsed: ")); - Serial.print((String)myGPS.getSurveyInObservationTime()); // Call the helper function + Serial.print((String)myGNSS.getSurveyInObservationTime()); // Call the helper function Serial.print(F(" (")); - Serial.print((String)myGPS.packetUBXNAVSVIN->data.dur); // Read the survey-in duration directly from packetUBXNAVSVIN + Serial.print((String)myGNSS.packetUBXNAVSVIN->data.dur); // Read the survey-in duration directly from packetUBXNAVSVIN Serial.print(F(") Accuracy: ")); - Serial.print((String)myGPS.getSurveyInMeanAccuracy()); // Call the helper function + Serial.print((String)myGNSS.getSurveyInMeanAccuracy()); // Call the helper function Serial.print(F(" (")); // Read the mean accuracy directly from packetUBXNAVSVIN and manually convert from mm*0.1 to m - float meanAcc = ((float)myGPS.packetUBXNAVSVIN->data.meanAcc) / 10000.0; + float meanAcc = ((float)myGNSS.packetUBXNAVSVIN->data.meanAcc) / 10000.0; Serial.print((String)meanAcc); Serial.println(F(")")); } @@ -166,12 +166,12 @@ void setup() Serial.println(F("Base survey complete! RTCM now broadcasting.")); - myGPS.setI2COutput(COM_TYPE_UBX | COM_TYPE_RTCM3); //Set the I2C port to output UBX and RTCM sentences (not really an option, turns on NMEA as well) + myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_RTCM3); //Set the I2C port to output UBX and RTCM sentences (not really an option, turns on NMEA as well) } void loop() { - myGPS.checkUblox(); //See if new data is available. Process bytes as they come in. + myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in. delay(250); //Don't pound too hard on the I2C bus } @@ -179,7 +179,7 @@ void loop() //This function gets called from the SparkFun u-blox Arduino Library. //As each RTCM byte comes in you can specify what to do with it //Useful for passing the RTCM correction data to a radio, Ntrip broadcaster, etc. -void SFE_UBLOX_GPS::processRTCM(uint8_t incoming) +void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming) { #ifdef USE_SERIAL1 //Push the RTCM data to Serial1 @@ -187,7 +187,7 @@ void SFE_UBLOX_GPS::processRTCM(uint8_t incoming) #endif //Pretty-print the HEX values to Serial - if (myGPS.rtcmFrameCounter % 16 == 0) Serial.println(); + if (myGNSS.rtcmFrameCounter % 16 == 0) Serial.println(); Serial.print(F(" ")); if (incoming < 0x10) Serial.print(F("0")); Serial.print(incoming, HEX); diff --git a/examples/ZED-F9P/Example4_BaseWithLCD/Example4_BaseWithLCD.ino b/examples/ZED-F9P/Example4_BaseWithLCD/Example4_BaseWithLCD.ino index 3286d64..f3275bf 100644 --- a/examples/ZED-F9P/Example4_BaseWithLCD/Example4_BaseWithLCD.ino +++ b/examples/ZED-F9P/Example4_BaseWithLCD/Example4_BaseWithLCD.ino @@ -32,7 +32,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; #include //Click here to get the library: http://librarymanager/All#SparkFun_SerLCD SerLCD lcd; // Initialize the library with default I2C address 0x72 @@ -54,8 +54,8 @@ void setup() lcd.clear(); lcd.print(F("LCD Ready")); - myGPS.begin(Wire); - if (myGPS.isConnected() == false) + myGNSS.begin(Wire); + if (myGNSS.isConnected() == false) { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); lcd.setCursor(0, 1); @@ -69,17 +69,17 @@ void setup() lcd.setCursor(0, 1); lcd.print("GNSS Detected"); - //myGPS.setI2COutput(COM_TYPE_RTCM3); //Set the I2C port to output RTCM3 sentences (turn off NMEA noise) - myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX sentences (turn off NMEA noise) - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR + //myGNSS.setI2COutput(COM_TYPE_RTCM3); //Set the I2C port to output RTCM3 sentences (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX sentences (turn off NMEA noise) + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR boolean response = true; - response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second - response &= myGPS.enableRTCMmessage(UBX_RTCM_1074, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1084, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1094, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1124, COM_PORT_I2C, 1); - response &= myGPS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1074, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1084, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1094, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1124, COM_PORT_I2C, 1); + response &= myGNSS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_I2C, 10); //Enable message every 10 seconds if (response == true) { Serial.println(F("RTCM messages enabled")); @@ -96,7 +96,7 @@ void setup() // Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t // You can either read the data from packetUBXNAVSVIN directly // or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; and getSurveyInMeanAccuracy - response = myGPS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (request can take a long time) + response = myGNSS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (request can take a long time) if (response == false) { Serial.println(F("Failed to get Survey In status. Freezing.")); @@ -104,7 +104,7 @@ void setup() ; //Freeze } - if (myGPS.getSurveyInActive() == true) // Use the helper function + if (myGNSS.getSurveyInActive() == true) // Use the helper function { Serial.print(F("Survey already in progress.")); lcd.setCursor(0, 2); @@ -113,7 +113,7 @@ void setup() else { //Start survey - response = myGPS.enableSurveyMode(60, 5.000); //Enable Survey in, 60 seconds, 5.0m + response = myGNSS.enableSurveyMode(60, 5.000); //Enable Survey in, 60 seconds, 5.0m if (response == false) { Serial.println(F("Survey start failed")); @@ -132,7 +132,7 @@ void setup() lcd.print(F("Survey in progress")); //Begin waiting for survey to complete - while (myGPS.getSurveyInValid() == false) // Call the helper function + while (myGNSS.getSurveyInValid() == false) // Call the helper function { if (Serial.available()) { @@ -140,7 +140,7 @@ void setup() if (incoming == 'x') { //Stop survey mode - response = myGPS.disableSurveyMode(); //Disable survey + response = myGNSS.disableSurveyMode(); //Disable survey Serial.println(F("Survey stopped")); break; } @@ -150,24 +150,24 @@ void setup() // Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t // You can either read the data from packetUBXNAVSVIN directly // or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; and getSurveyInMeanAccuracy - response = myGPS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (req can take a long time) + response = myGNSS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (req can take a long time) if (response == true) { Serial.print(F("Press x to end survey - ")); Serial.print(F("Time elapsed: ")); - Serial.print((String)myGPS.getSurveyInObservationTime()); // Call the helper function + Serial.print((String)myGNSS.getSurveyInObservationTime()); // Call the helper function lcd.setCursor(0, 1); lcd.print(F("Elapsed: ")); - lcd.print((String)myGPS.getSurveyInObservationTime()); // Call the helper function + lcd.print((String)myGNSS.getSurveyInObservationTime()); // Call the helper function Serial.print(F(" Accuracy: ")); - Serial.print((String)myGPS.getSurveyInMeanAccuracy()); // Call the helper function + Serial.print((String)myGNSS.getSurveyInMeanAccuracy()); // Call the helper function Serial.println(); lcd.setCursor(0, 2); lcd.print(F("Accuracy: ")); - lcd.print((String)myGPS.getSurveyInMeanAccuracy()); // Call the helper function + lcd.print((String)myGNSS.getSurveyInMeanAccuracy()); // Call the helper function } else { @@ -182,13 +182,13 @@ void setup() lcd.clear(); lcd.print(F("Transmitting RTCM")); - myGPS.setI2COutput(COM_TYPE_UBX | COM_TYPE_RTCM3); //Set the I2C port to output UBX and RTCM sentences (not really an option, turns on NMEA as well) + myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_RTCM3); //Set the I2C port to output UBX and RTCM sentences (not really an option, turns on NMEA as well) } void loop() { - myGPS.checkUblox(); //See if new data is available. Process bytes as they come in. + myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in. //Do anything you want. Call checkUblox() every second. ZED-F9P has TX buffer of 4k bytes. @@ -198,10 +198,10 @@ void loop() //This function gets called from the SparkFun u-blox Arduino Library. //As each RTCM byte comes in you can specify what to do with it //Useful for passing the RTCM correction data to a radio, Ntrip broadcaster, etc. -void SFE_UBLOX_GPS::processRTCM(uint8_t incoming) +void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming) { //Let's just pretty-print the HEX values for now - if (myGPS.rtcmFrameCounter % 16 == 0) + if (myGNSS.rtcmFrameCounter % 16 == 0) Serial.println(); Serial.print(" "); if (incoming < 0x10) diff --git a/examples/ZED-F9P/Example5_RelativePositioningInformation/Example5_RelativePositioningInformation.ino b/examples/ZED-F9P/Example5_RelativePositioningInformation/Example5_RelativePositioningInformation.ino index c433593..ea2faae 100644 --- a/examples/ZED-F9P/Example5_RelativePositioningInformation/Example5_RelativePositioningInformation.ino +++ b/examples/ZED-F9P/Example5_RelativePositioningInformation/Example5_RelativePositioningInformation.ino @@ -24,7 +24,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; //#define USE_SERIAL1 // Uncomment this line to push the RTCM data from Serial1 to the module via I2C @@ -44,19 +44,19 @@ void setup() Wire.begin(); Wire.setClock(400000); //Increase I2C clock speed to 400kHz - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1); } // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate - //myGPS.factoryDefault(); delay(5000); + //myGNSS.factoryDefault(); delay(5000); #ifdef USE_SERIAL1 Serial.print(F("Enabling UBX and RTCM input on I2C. Result: ")); - Serial.print(myGPS.setPortInput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_RTCM3)); //Enable UBX and RTCM input on I2C - myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR + Serial.print(myGNSS.setPortInput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_RTCM3)); //Enable UBX and RTCM input on I2C + myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR #endif } @@ -66,76 +66,76 @@ void loop() // Please see u-blox_structs.h for the full definition of UBX_NAV_RELPOSNED_t // You can either read the data from packetUBXNAVRELPOSNED directly // or can use the helper functions: getRelPosN/E/D; getRelPosAccN/E/D - if (myGPS.getRELPOSNED() == true) + if (myGNSS.getRELPOSNED() == true) { Serial.print("relPosN: "); - Serial.println(myGPS.getRelPosN(), 4); // Use the helper functions to get the rel. pos. as m + Serial.println(myGNSS.getRelPosN(), 4); // Use the helper functions to get the rel. pos. as m Serial.print("relPosE: "); - Serial.println(myGPS.getRelPosE(), 4); + Serial.println(myGNSS.getRelPosE(), 4); Serial.print("relPosD: "); - Serial.println(myGPS.getRelPosD(), 4); + Serial.println(myGNSS.getRelPosD(), 4); Serial.print("relPosLength: "); - Serial.println(myGPS.packetUBXNAVRELPOSNED->data.relPosLength); + Serial.println(myGNSS.packetUBXNAVRELPOSNED->data.relPosLength); Serial.print("relPosHeading: "); - Serial.println(myGPS.packetUBXNAVRELPOSNED->data.relPosHeading); + Serial.println(myGNSS.packetUBXNAVRELPOSNED->data.relPosHeading); Serial.print("relPosHPN: "); - Serial.println(myGPS.packetUBXNAVRELPOSNED->data.relPosHPN); + Serial.println(myGNSS.packetUBXNAVRELPOSNED->data.relPosHPN); Serial.print("relPosHPE: "); - Serial.println(myGPS.packetUBXNAVRELPOSNED->data.relPosHPE); + Serial.println(myGNSS.packetUBXNAVRELPOSNED->data.relPosHPE); Serial.print("relPosHPD: "); - Serial.println(myGPS.packetUBXNAVRELPOSNED->data.relPosHPD); + Serial.println(myGNSS.packetUBXNAVRELPOSNED->data.relPosHPD); Serial.print("relPosHPLength: "); - Serial.println(myGPS.packetUBXNAVRELPOSNED->data.relPosHPLength); + Serial.println(myGNSS.packetUBXNAVRELPOSNED->data.relPosHPLength); Serial.print("accN: "); - Serial.println(myGPS.getRelPosAccN(), 4); // Use the helper functions to get the rel. pos. accuracy as m + Serial.println(myGNSS.getRelPosAccN(), 4); // Use the helper functions to get the rel. pos. accuracy as m Serial.print("accE: "); - Serial.println(myGPS.getRelPosAccE(), 4); + Serial.println(myGNSS.getRelPosAccE(), 4); Serial.print("accD: "); - Serial.println(myGPS.getRelPosAccD(), 4); + Serial.println(myGNSS.getRelPosAccD(), 4); Serial.print("gnssFixOk: "); - if (myGPS.packetUBXNAVRELPOSNED->data.flags.bits.gnssFixOK == true) + if (myGNSS.packetUBXNAVRELPOSNED->data.flags.bits.gnssFixOK == true) Serial.println("x"); else Serial.println(""); Serial.print("diffSolution: "); - if (myGPS.packetUBXNAVRELPOSNED->data.flags.bits.diffSoln == true) + if (myGNSS.packetUBXNAVRELPOSNED->data.flags.bits.diffSoln == true) Serial.println("x"); else Serial.println(""); Serial.print("relPosValid: "); - if (myGPS.packetUBXNAVRELPOSNED->data.flags.bits.relPosValid == true) + if (myGNSS.packetUBXNAVRELPOSNED->data.flags.bits.relPosValid == true) Serial.println("x"); else Serial.println(""); Serial.print("carrier Solution Type: "); - if (myGPS.packetUBXNAVRELPOSNED->data.flags.bits.carrSoln == 0) + if (myGNSS.packetUBXNAVRELPOSNED->data.flags.bits.carrSoln == 0) Serial.println("None"); - else if (myGPS.packetUBXNAVRELPOSNED->data.flags.bits.carrSoln == 1) + else if (myGNSS.packetUBXNAVRELPOSNED->data.flags.bits.carrSoln == 1) Serial.println("Float"); - else if (myGPS.packetUBXNAVRELPOSNED->data.flags.bits.carrSoln == 2) + else if (myGNSS.packetUBXNAVRELPOSNED->data.flags.bits.carrSoln == 2) Serial.println("Fixed"); Serial.print("isMoving: "); - if (myGPS.packetUBXNAVRELPOSNED->data.flags.bits.isMoving == true) + if (myGNSS.packetUBXNAVRELPOSNED->data.flags.bits.isMoving == true) Serial.println("x"); else Serial.println(""); Serial.print("refPosMiss: "); - if (myGPS.packetUBXNAVRELPOSNED->data.flags.bits.refPosMiss == true) + if (myGNSS.packetUBXNAVRELPOSNED->data.flags.bits.refPosMiss == true) Serial.println("x"); else Serial.println(""); Serial.print("refObsMiss: "); - if (myGPS.packetUBXNAVRELPOSNED->data.flags.bits.refObsMiss == true) + if (myGNSS.packetUBXNAVRELPOSNED->data.flags.bits.refObsMiss == true) Serial.println("x"); else Serial.println(""); @@ -156,7 +156,7 @@ void loop() //Serial.print("Pushing "); //Serial.print(numBytes); //Serial.println(" bytes via I2C"); - myGPS.pushRawData(((uint8_t *)&store), numBytes); // Push the RTCM data via I2C + myGNSS.pushRawData(((uint8_t *)&store), numBytes); // Push the RTCM data via I2C numBytes = 0; // Reset numBytes } #endif diff --git a/examples/ZED-F9P/Example6_GetVal/Example6_GetVal.ino b/examples/ZED-F9P/Example6_GetVal/Example6_GetVal.ino index da42c32..1b610ab 100644 --- a/examples/ZED-F9P/Example6_GetVal/Example6_GetVal.ino +++ b/examples/ZED-F9P/Example6_GetVal/Example6_GetVal.ino @@ -25,7 +25,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -39,17 +39,17 @@ void setup() Wire.begin(); Wire.setClock(400000); //Increase I2C clock speed to 400kHz - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - //myGPS.enableDebugging(); //Enable debug messages over Serial (default) - //myGPS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB + //myGNSS.enableDebugging(); //Enable debug messages over Serial (default) + //myGNSS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB - uint8_t currentI2Caddress = myGPS.getVal8(UBLOX_CFG_I2C_ADDRESS); + uint8_t currentI2Caddress = myGNSS.getVal8(UBLOX_CFG_I2C_ADDRESS); Serial.print("Current I2C address (should be 0x42): 0x"); Serial.println(currentI2Caddress >> 1, HEX); //u-blox module returns a shifted 8-bit address. Make it 7-bit unshifted. } diff --git a/examples/ZED-F9P/Example7_SetVal/Example7_SetVal.ino b/examples/ZED-F9P/Example7_SetVal/Example7_SetVal.ino index cbe7d36..7e25fe9 100644 --- a/examples/ZED-F9P/Example7_SetVal/Example7_SetVal.ino +++ b/examples/ZED-F9P/Example7_SetVal/Example7_SetVal.ino @@ -25,7 +25,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module. @@ -39,29 +39,29 @@ void setup() Wire.begin(); Wire.setClock(400000); //Increase I2C clock speed to 400kHz - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - //myGPS.enableDebugging(); //Enable debug messages over Serial (default) - //myGPS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB + //myGNSS.enableDebugging(); //Enable debug messages over Serial (default) + //myGNSS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB bool setValueSuccess; //These key values are hard coded and defined in u-blox_config_keys.h. //You can obtain them from the ZED-F9P interface description doc //or from u-center's Messages->CFG->VALSET window. Keys must be 32-bit. - //setValueSuccess = myGPS.setVal(UBLOX_CFG_NMEA_HIGHPREC, 0); //Enable high precision NMEA - //setValueSuccess = myGPS.setVal(UBLOX_CFG_RATE_MEAS, 1000); //Set measurement rate to 100ms (10Hz update rate) - setValueSuccess = myGPS.setVal(UBLOX_CFG_RATE_MEAS, 1000); //Set measurement rate to 1000ms (1Hz update rate) + //setValueSuccess = myGNSS.setVal(UBLOX_CFG_NMEA_HIGHPREC, 0); //Enable high precision NMEA + //setValueSuccess = myGNSS.setVal(UBLOX_CFG_RATE_MEAS, 1000); //Set measurement rate to 100ms (10Hz update rate) + setValueSuccess = myGNSS.setVal(UBLOX_CFG_RATE_MEAS, 1000); //Set measurement rate to 1000ms (1Hz update rate) //Below is the original way we enabled the RTCM message on the I2C port. After that, we show how to do the same //but with setVal(). - //Original: myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second - //setValueSuccess = myGPS.setVal(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1); //Set output rate of msg 1005 over the I2C port to once per second + //Original: myGNSS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second + //setValueSuccess = myGNSS.setVal(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1); //Set output rate of msg 1005 over the I2C port to once per second if (setValueSuccess == true) { diff --git a/examples/ZED-F9P/Example8_GetSetPortSettings/Example8_GetSetPortSettings.ino b/examples/ZED-F9P/Example8_GetSetPortSettings/Example8_GetSetPortSettings.ino index 242cfb4..54e359b 100644 --- a/examples/ZED-F9P/Example8_GetSetPortSettings/Example8_GetSetPortSettings.ino +++ b/examples/ZED-F9P/Example8_GetSetPortSettings/Example8_GetSetPortSettings.ino @@ -24,7 +24,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -35,7 +35,7 @@ void setup() Wire.begin(); - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) @@ -45,9 +45,9 @@ void setup() bool response = true; //Read the settings from RAM (what the module is running right now, not BBR, Flash, or default) - uint8_t currentUART1Setting_ubx = myGPS.getVal8(UBLOX_CFG_UART1INPROT_UBX); - uint8_t currentUART1Setting_nmea = myGPS.getVal8(UBLOX_CFG_UART1INPROT_NMEA); - uint8_t currentUART1Setting_rtcm3 = myGPS.getVal8(UBLOX_CFG_UART1INPROT_RTCM3X); + uint8_t currentUART1Setting_ubx = myGNSS.getVal8(UBLOX_CFG_UART1INPROT_UBX); + uint8_t currentUART1Setting_nmea = myGNSS.getVal8(UBLOX_CFG_UART1INPROT_NMEA); + uint8_t currentUART1Setting_rtcm3 = myGNSS.getVal8(UBLOX_CFG_UART1INPROT_RTCM3X); Serial.print("currentUART1Setting_ubx: "); Serial.println(currentUART1Setting_ubx); @@ -62,9 +62,9 @@ void setup() Serial.println("Updating UART1 configuration"); //setVal sets the values for RAM, BBR, and Flash automatically so no .saveConfiguration() is needed - response &= myGPS.setVal8(UBLOX_CFG_UART1INPROT_UBX, 1); //Enable UBX on UART1 Input - response &= myGPS.setVal8(UBLOX_CFG_UART1INPROT_NMEA, 1); //Enable NMEA on UART1 Input - response &= myGPS.setVal8(UBLOX_CFG_UART1INPROT_RTCM3X, 0); //Disable RTCM on UART1 Input + response &= myGNSS.setVal8(UBLOX_CFG_UART1INPROT_UBX, 1); //Enable UBX on UART1 Input + response &= myGNSS.setVal8(UBLOX_CFG_UART1INPROT_NMEA, 1); //Enable NMEA on UART1 Input + response &= myGNSS.setVal8(UBLOX_CFG_UART1INPROT_RTCM3X, 0); //Disable RTCM on UART1 Input if (response == false) Serial.println("SetVal failed"); @@ -75,13 +75,13 @@ void setup() Serial.println("No port change needed"); //Change speed of UART2 - uint32_t currentUART2Baud = myGPS.getVal32(UBLOX_CFG_UART2_BAUDRATE); + uint32_t currentUART2Baud = myGNSS.getVal32(UBLOX_CFG_UART2_BAUDRATE); Serial.print("currentUART2Baud: "); Serial.println(currentUART2Baud); if (currentUART2Baud != 57600) { - response &= myGPS.setVal32(UBLOX_CFG_UART2_BAUDRATE, 57600); + response &= myGNSS.setVal32(UBLOX_CFG_UART2_BAUDRATE, 57600); if (response == false) Serial.println("SetVal failed"); else diff --git a/examples/ZED-F9P/Example9_multiSetVal/Example9_multiSetVal.ino b/examples/ZED-F9P/Example9_multiSetVal/Example9_multiSetVal.ino index 8a161a6..8d5088a 100644 --- a/examples/ZED-F9P/Example9_multiSetVal/Example9_multiSetVal.ino +++ b/examples/ZED-F9P/Example9_multiSetVal/Example9_multiSetVal.ino @@ -26,7 +26,7 @@ #include //Needed for I2C to GNSS #include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_u-blox_GNSS -SFE_UBLOX_GPS myGPS; +SFE_UBLOX_GNSS myGNSS; void setup() { @@ -38,15 +38,15 @@ void setup() Wire.begin(); Wire.setClock(400000); //Increase I2C clock speed to 400kHz - if (myGPS.begin() == false) //Connect to the u-blox module using Wire port + if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port { Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.")); while (1) ; } - //myGPS.enableDebugging(); //Enable debug messages over Serial (default) - //myGPS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB + //myGNSS.enableDebugging(); //Enable debug messages over Serial (default) + //myGNSS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB bool setValueSuccess = true; @@ -57,25 +57,25 @@ void setup() //U2, I2, E2 and X2 values are 16-bit //U4, I4, R4, E4, X4 values are 32-bit - setValueSuccess &= myGPS.setVal8(UBLOX_CFG_NMEA_HIGHPREC, 0); //Enable high precision NMEA (value is 8-bit (L / U1)) - //setValueSuccess &= myGPS.setVal16(UBLOX_CFG_RATE_MEAS, 200); //Set measurement rate to 100ms (10Hz update rate) (value is 16-bit (U2)) - //setValueSuccess &= myGPS.setVal16(UBLOX_CFG_RATE_MEAS, 200, 1); //Set rate setting in RAM instead of BBR - setValueSuccess &= myGPS.setVal16(UBLOX_CFG_RATE_MEAS, 1000); //Set measurement rate to 1000ms (1Hz update rate) (value is 16-bit (U2)) + setValueSuccess &= myGNSS.setVal8(UBLOX_CFG_NMEA_HIGHPREC, 0); //Enable high precision NMEA (value is 8-bit (L / U1)) + //setValueSuccess &= myGNSS.setVal16(UBLOX_CFG_RATE_MEAS, 200); //Set measurement rate to 100ms (10Hz update rate) (value is 16-bit (U2)) + //setValueSuccess &= myGNSS.setVal16(UBLOX_CFG_RATE_MEAS, 200, 1); //Set rate setting in RAM instead of BBR + setValueSuccess &= myGNSS.setVal16(UBLOX_CFG_RATE_MEAS, 1000); //Set measurement rate to 1000ms (1Hz update rate) (value is 16-bit (U2)) //Below is the original way we enabled a single RTCM message on the I2C port. After that, we show how to do the same //but with multiple messages all in one go using newCfgValset, addCfgValset and sendCfgValset. - //Original: myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second + //Original: myGNSS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second //Begin with newCfgValset8/16/32 - setValueSuccess &= myGPS.newCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1); //Set output rate of msg 1005 over the I2C port to once per measurement (value is 8-bit (U1)) - //setValueSuccess &= myGPS.newCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1, VAL_LAYER_RAM); //Set this and the following settings in RAM only instead of Flash/RAM/BBR + setValueSuccess &= myGNSS.newCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1); //Set output rate of msg 1005 over the I2C port to once per measurement (value is 8-bit (U1)) + //setValueSuccess &= myGNSS.newCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1, VAL_LAYER_RAM); //Set this and the following settings in RAM only instead of Flash/RAM/BBR //Add extra keyIDs and values using addCfgValset8/16/32 - setValueSuccess &= myGPS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1077_I2C, 1); //Set output rate of msg 1077 over the I2C port to once per measurement (value is 8-bit (U1)) - setValueSuccess &= myGPS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1087_I2C, 1); //Set output rate of msg 1087 over the I2C port to once per measurement (value is 8-bit (U1)) - setValueSuccess &= myGPS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1127_I2C, 1); //Set output rate of msg 1127 over the I2C port to once per measurement (value is 8-bit (U1)) - setValueSuccess &= myGPS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1097_I2C, 1); //Set output rate of msg 1097 over the I2C port to once per measurement (value is 8-bit (U1)) + setValueSuccess &= myGNSS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1077_I2C, 1); //Set output rate of msg 1077 over the I2C port to once per measurement (value is 8-bit (U1)) + setValueSuccess &= myGNSS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1087_I2C, 1); //Set output rate of msg 1087 over the I2C port to once per measurement (value is 8-bit (U1)) + setValueSuccess &= myGNSS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1127_I2C, 1); //Set output rate of msg 1127 over the I2C port to once per measurement (value is 8-bit (U1)) + setValueSuccess &= myGNSS.addCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1097_I2C, 1); //Set output rate of msg 1097 over the I2C port to once per measurement (value is 8-bit (U1)) // Add the final value and send the packet using sendCfgValset8/16/32 - setValueSuccess &= myGPS.sendCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1230_I2C, 10); //Set output rate of msg 1230 over the I2C port to once every 10 measurements (value is 8-bit (U1)) + setValueSuccess &= myGNSS.sendCfgValset8(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1230_I2C, 10); //Set output rate of msg 1230 over the I2C port to once every 10 measurements (value is 8-bit (U1)) if (setValueSuccess == true) {