Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Support for series 6 and 7: incorporating the changes from PR #114 #115

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ U-blox makes some incredible GPS receivers covering everything from low-cost, hi

This library can be installed via the Arduino Library manager. Search for **SparkFun Ublox**.

Although not an integrated part of the library, you will find an example of how to communicate with the older series 6 and 7 modules in the [examples folder](./examples/Series_6_7).

Max (400kHz) I2C Support
-------------------
Expand All @@ -36,15 +37,16 @@ Want to help? Please do! We are always looking for ways to improve and build out

Thanks to:

* [trycoon](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/pull/7) for fixing the lack of I2C buffer length defines
* [tve](https://github.com/tve) for building out serial additions and examples
* [Redstoned](https://github.com/Redstoned) and [davidallenmann](https://github.com/davidallenmann) for adding PVT date and time
* [wittend](https://forum.sparkfun.com/viewtopic.php?t=49874) for pointing out the RTCM print bug
* [trycoon](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/pull/7) for fixing the lack of I2C buffer length defines.
* [tve](https://github.com/tve) for building out serial additions and examples.
* [Redstoned](https://github.com/Redstoned) and [davidallenmann](https://github.com/davidallenmann) for adding PVT date and time.
* [wittend](https://forum.sparkfun.com/viewtopic.php?t=49874) for pointing out the RTCM print bug.
* Big thanks to [PaulZC](https://github.com/PaulZC) for implementing the combined key ValSet method, geofence functions, better saveConfig handling, as well as a bunch of small fixes.
* [RollieRowland](https://github.com/RollieRowland) for adding HPPOSLLH (High Precision Geodetic Position)
* [tedder](https://github.com/tedder) for moving iTOW to PVT instead of HPPOS and comment cleanup
* [grexjmo](https://github.com/grexjmo) for pushing for a better NMEA sentence configuration method
* [RollieRowland](https://github.com/RollieRowland) for adding HPPOSLLH (High Precision Geodetic Position).
* [tedder](https://github.com/tedder) for moving iTOW to PVT instead of HPPOS and comment cleanup.
* [grexjmo](https://github.com/grexjmo) for pushing for a better NMEA sentence configuration method.
* [averywallis](https://github.com/averywallis) for adding good comments to the various constants.
* [blazczak](https://github.com/blazczak) and [geeksville](https://github.com/geeksville) for adding support for the series 6 and 7 modules.

Need a library for the Ublox and Particle? Checkout the [Particle library](https://github.com/aseelye/SparkFun_u-blox_Particle_Library) fork.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
Reading lat, long and UTC time via UBX binary commands - no more NMEA parsing!
By: Paul Clark and Nathan Seidle
Using the library modifications provided by @blazczak and @geeksville

SparkFun Electronics
Date: June 16th, 2020
License: MIT. See license file for more information but you can
basically do whatever you want with this code.

This example shows how to query a Ublox module for its lat/long/altitude. We also
turn off the NMEA output on the I2C port. This decreases the amount of I2C traffic
dramatically.

Note: Long/lat are large numbers because they are * 10^7. To convert lat/long
to something google maps understands simply divide the numbers by 10,000,000. We
do this so that we don't have to use floating point numbers.

Leave NMEA parsing behind. Now you can simply ask the module for the datums you want!

Feel like supporting open source hardware?
Buy a board from SparkFun!
ZED-F9P RTK2: https://www.sparkfun.com/products/15136
NEO-M8P RTK: https://www.sparkfun.com/products/15005
SAM-M8Q: https://www.sparkfun.com/products/15106

Hardware Connections:
Plug a Qwiic cable into the GPS and a BlackBoard
If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
Open the serial monitor at 115200 baud to see the output
*/

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

#include "SparkFun_Ublox_Arduino_Library_Series_6_7.h"
SFE_UBLOX_GPS myGPS;

long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to Ublox module.

void setup()
{
Serial.begin(115200);
while (!Serial); //Wait for user to open terminal
Serial.println("SparkFun Ublox Example");

Wire.begin();

//myGPS.enableDebugging(); // Uncomment this line to enable debug messages

if (myGPS.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.saveConfiguration(); //Save the current settings to flash and BBR
}

void loop()
{
//Query module only every second. Doing it more often will just cause I2C traffic.
//The module only responds when a new position is available
if (millis() - lastTime > 1000)
{
lastTime = millis(); //Update the timer

long latitude = myGPS.getLatitude();
Serial.print(F("Lat: "));
Serial.print(latitude);

long longitude = myGPS.getLongitude();
Serial.print(F(" Long: "));
Serial.print(longitude);
Serial.print(F(" (degrees * 10^-7)"));

long altitude = myGPS.getAltitude();
Serial.print(F(" Alt: "));
Serial.print(altitude);
Serial.print(F(" (mm)"));

Serial.print(F(" Time: "));

byte Hour = myGPS.getHour();
if (Hour < 10)
{
Serial.print(F("0"));
}
Serial.print(Hour);
Serial.print(F(":"));

byte Minute = myGPS.getMinute();
if (Minute < 10)
{
Serial.print(F("0"));
}
Serial.print(Minute);
Serial.print(F(":"));

byte Second = myGPS.getSecond();
if (Second < 10)
{
Serial.print(F("0"));
}
Serial.print(Second);

Serial.println();
}
}
Loading