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

Commit 69c0ae8

Browse files
committed
Adding thanks to TVE for PR. Change Ex11 to use software serial.
1 parent 08e78b6 commit 69c0ae8

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ SparkFun Ublox Arduino Library
1414
</tr>
1515
</table>
1616

17-
Ublox makes some incredible GPS receivers covering everything from low-cost, highly configurable modules such as the SAM-M8Q all the way up to the surveyor grade ZED-F9P with precision of the diameter of a dime. This library focuses on configuration and control of Ublox devices over I2C (called DDC by Ublox). An I2C interface combined with the binary UBX protocol makes for a much easier and lighterweight interface to a GPS module. Stop parsing NMEA data! And simply ask for the datums you need.
17+
Ublox makes some incredible GPS receivers covering everything from low-cost, highly configurable modules such as the SAM-M8Q all the way up to the surveyor grade ZED-F9P with precision of the diameter of a dime. This library focuses on configuration and control of Ublox devices over I2C (called DDC by Ublox) and Serial. The UBX protocol is supported over both I2C and serial, and is a much easier and lighterweight interface to a GPS module. Stop parsing NMEA data! And simply ask for the datums you need.
1818

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

2121
Want to help? Please do! We are always looking for ways to improve and build out features of this library.
2222

23+
* Special thanks to [tve](https://github.com/tve) for building out serial additions and examples.
24+
* We are always interested in adding SPI support with a checkUbloxSPI() function
25+
2326
Need a library for the Ublox and Particle? Checkout the [Particle library](https://github.com/aseelye/SparkFun_Ublox_Particle_Library) fork.
2427

2528
Repository Contents

examples/Example11_UseUart/Example11_UseUart.ino

+11-7
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@
2222
SAM-M8Q: https://www.sparkfun.com/products/15106
2323
2424
Hardware Connections:
25-
Connect the U-Blox serial port to Serial1
25+
Connect the U-Blox serial TX pin to Uno pin 10
26+
Connect the U-Blox serial RX pin to Uno pin 11
2627
Open the serial monitor at 115200 baud to see the output
2728
*/
2829

2930
#include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_Ublox_GPS
3031
SFE_UBLOX_GPS myGPS;
3132

32-
long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to Ublox module.
33+
#include <SoftwareSerial.h>
34+
SoftwareSerial mySerial(10, 11); // RX, TX. Pin 10 on Uno goes to TX pin on GPS module.
35+
36+
long lastTime = 0; //Simple local timer. Limits amount of I2C traffic to Ublox module.
3337

3438
void setup()
3539
{
@@ -41,18 +45,18 @@ void setup()
4145
//Loop until we're in sync and then ensure it's at 38400 baud.
4246
do {
4347
Serial.println("GPS: trying 38400 baud");
44-
Serial1.begin(38400);
45-
if (myGPS.begin(Serial1)) break;
48+
mySerial.begin(38400);
49+
if (myGPS.begin(mySerial) == true) break;
4650

4751
delay(100);
4852
Serial.println("GPS: trying 9600 baud");
49-
Serial1.begin(9600);
50-
if (myGPS.begin(Serial1)) {
53+
mySerial.begin(9600);
54+
if (myGPS.begin(mySerial) == true) {
5155
Serial.println("GPS: connected at 9600 baud, switching to 38400");
5256
myGPS.setSerialRate(38400);
5357
delay(100);
5458
} else {
55-
//gps.factoryReset();
59+
//myGPS.factoryReset();
5660
delay(2000); //Wait a bit before trying again to limit the Serial output
5761
}
5862
} while(1);

examples/Example12_Reset/src/Example12_Reset.ino

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
License: MIT. See license file for more information but you can
66
basically do whatever you want with this code.
77
8-
This example shows how to reset the U-Box module.
8+
This example shows how to reset the U-Blox module to factory defaults.
99
1010
Feel like supporting open source hardware?
1111
Buy a board from SparkFun!
@@ -15,6 +15,7 @@
1515
1616
Hardware Connections:
1717
Connect the U-Blox serial port to Serial1
18+
If you're using an Uno or don't have a 2nd serial port (Serial1), consider using software serial
1819
Open the serial monitor at 115200 baud to see the output
1920
*/
2021

0 commit comments

Comments
 (0)