Updating examples: change class name & update header file
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include <Wire.h> //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
|
||||
|
||||
Reference in New Issue
Block a user