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