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

Commit a96733b

Browse files
authored
Merge pull request #115 from sparkfun/Adding_Series_6_and_7
Support for series 6 and 7: incorporating the changes from PR #114
2 parents a1d0937 + e114d63 commit a96733b

File tree

4 files changed

+4524
-7
lines changed

4 files changed

+4524
-7
lines changed

Diff for: README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ U-blox makes some incredible GPS receivers covering everything from low-cost, hi
2222

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

25+
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).
2526

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

3738
Thanks to:
3839

39-
* [trycoon](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/pull/7) for fixing the lack of I2C buffer length defines
40-
* [tve](https://github.com/tve) for building out serial additions and examples
41-
* [Redstoned](https://github.com/Redstoned) and [davidallenmann](https://github.com/davidallenmann) for adding PVT date and time
42-
* [wittend](https://forum.sparkfun.com/viewtopic.php?t=49874) for pointing out the RTCM print bug
40+
* [trycoon](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/pull/7) for fixing the lack of I2C buffer length defines.
41+
* [tve](https://github.com/tve) for building out serial additions and examples.
42+
* [Redstoned](https://github.com/Redstoned) and [davidallenmann](https://github.com/davidallenmann) for adding PVT date and time.
43+
* [wittend](https://forum.sparkfun.com/viewtopic.php?t=49874) for pointing out the RTCM print bug.
4344
* 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.
44-
* [RollieRowland](https://github.com/RollieRowland) for adding HPPOSLLH (High Precision Geodetic Position)
45-
* [tedder](https://github.com/tedder) for moving iTOW to PVT instead of HPPOS and comment cleanup
46-
* [grexjmo](https://github.com/grexjmo) for pushing for a better NMEA sentence configuration method
45+
* [RollieRowland](https://github.com/RollieRowland) for adding HPPOSLLH (High Precision Geodetic Position).
46+
* [tedder](https://github.com/tedder) for moving iTOW to PVT instead of HPPOS and comment cleanup.
47+
* [grexjmo](https://github.com/grexjmo) for pushing for a better NMEA sentence configuration method.
4748
* [averywallis](https://github.com/averywallis) for adding good comments to the various constants.
49+
* [blazczak](https://github.com/blazczak) and [geeksville](https://github.com/geeksville) for adding support for the series 6 and 7 modules.
4850

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

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/*
2+
Reading lat, long and UTC time via UBX binary commands - no more NMEA parsing!
3+
By: Paul Clark and Nathan Seidle
4+
Using the library modifications provided by @blazczak and @geeksville
5+
6+
SparkFun Electronics
7+
Date: June 16th, 2020
8+
License: MIT. See license file for more information but you can
9+
basically do whatever you want with this code.
10+
11+
This example shows how to query a Ublox module for its lat/long/altitude. We also
12+
turn off the NMEA output on the I2C port. This decreases the amount of I2C traffic
13+
dramatically.
14+
15+
Note: Long/lat are large numbers because they are * 10^7. To convert lat/long
16+
to something google maps understands simply divide the numbers by 10,000,000. We
17+
do this so that we don't have to use floating point numbers.
18+
19+
Leave NMEA parsing behind. Now you can simply ask the module for the datums you want!
20+
21+
Feel like supporting open source hardware?
22+
Buy a board from SparkFun!
23+
ZED-F9P RTK2: https://www.sparkfun.com/products/15136
24+
NEO-M8P RTK: https://www.sparkfun.com/products/15005
25+
SAM-M8Q: https://www.sparkfun.com/products/15106
26+
27+
Hardware Connections:
28+
Plug a Qwiic cable into the GPS and a BlackBoard
29+
If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
30+
Open the serial monitor at 115200 baud to see the output
31+
*/
32+
33+
#include <Wire.h> //Needed for I2C to GPS
34+
35+
#include "SparkFun_Ublox_Arduino_Library_Series_6_7.h"
36+
SFE_UBLOX_GPS myGPS;
37+
38+
long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to Ublox module.
39+
40+
void setup()
41+
{
42+
Serial.begin(115200);
43+
while (!Serial); //Wait for user to open terminal
44+
Serial.println("SparkFun Ublox Example");
45+
46+
Wire.begin();
47+
48+
//myGPS.enableDebugging(); // Uncomment this line to enable debug messages
49+
50+
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
51+
{
52+
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
53+
while (1);
54+
}
55+
56+
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
57+
myGPS.saveConfiguration(); //Save the current settings to flash and BBR
58+
}
59+
60+
void loop()
61+
{
62+
//Query module only every second. Doing it more often will just cause I2C traffic.
63+
//The module only responds when a new position is available
64+
if (millis() - lastTime > 1000)
65+
{
66+
lastTime = millis(); //Update the timer
67+
68+
long latitude = myGPS.getLatitude();
69+
Serial.print(F("Lat: "));
70+
Serial.print(latitude);
71+
72+
long longitude = myGPS.getLongitude();
73+
Serial.print(F(" Long: "));
74+
Serial.print(longitude);
75+
Serial.print(F(" (degrees * 10^-7)"));
76+
77+
long altitude = myGPS.getAltitude();
78+
Serial.print(F(" Alt: "));
79+
Serial.print(altitude);
80+
Serial.print(F(" (mm)"));
81+
82+
Serial.print(F(" Time: "));
83+
84+
byte Hour = myGPS.getHour();
85+
if (Hour < 10)
86+
{
87+
Serial.print(F("0"));
88+
}
89+
Serial.print(Hour);
90+
Serial.print(F(":"));
91+
92+
byte Minute = myGPS.getMinute();
93+
if (Minute < 10)
94+
{
95+
Serial.print(F("0"));
96+
}
97+
Serial.print(Minute);
98+
Serial.print(F(":"));
99+
100+
byte Second = myGPS.getSecond();
101+
if (Second < 10)
102+
{
103+
Serial.print(F("0"));
104+
}
105+
Serial.print(Second);
106+
107+
Serial.println();
108+
}
109+
}

0 commit comments

Comments
 (0)