Updating examples: change class name & update header file
This commit is contained in:
+16
-16
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user