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

Commit a88ebac

Browse files
committed
Adding temp example for factory reset as well as keywords update.
1 parent 09be350 commit a88ebac

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
Test baud rate changes on serial, factory reset, and hard reset.
3+
By: Thorsten von Eicken
4+
Date: January 29rd, 2019
5+
License: MIT. See license file for more information but you can
6+
basically do whatever you want with this code.
7+
8+
This example shows how to reset the U-Blox module to factory defaults.
9+
10+
Feel like supporting open source hardware?
11+
Buy a board from SparkFun!
12+
ZED-F9P RTK2: https://www.sparkfun.com/products/15136
13+
NEO-M8P RTK: https://www.sparkfun.com/products/15005
14+
SAM-M8Q: https://www.sparkfun.com/products/15106
15+
16+
Hardware Connections:
17+
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
19+
Open the serial monitor at 115200 baud to see the output
20+
*/
21+
22+
#include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_Ublox_GPS
23+
SFE_UBLOX_GPS myGPS;
24+
25+
int state = 0; // steps through auto-baud, reset, etc states
26+
27+
void setup()
28+
{
29+
Serial.begin(115200);
30+
while (!Serial); //Wait for user to open terminal
31+
Serial.println("SparkFun Ublox Example");
32+
33+
Wire.begin();
34+
35+
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
36+
{
37+
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
38+
while (1);
39+
}
40+
41+
while (Serial.available()) Serial.read(); //Trash any incoming chars
42+
Serial.println("Press a key to reset module to factory defaults");
43+
while (Serial.available() == false) ; //Wait for user to send character
44+
45+
myGPS.factoryReset();
46+
47+
if (myGPS.begin() == false) //Attempt to re-connect
48+
{
49+
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
50+
while (1);
51+
}
52+
53+
Serial.println("Unit has now been factory reset. Freezing...");
54+
while(1);
55+
}
56+
57+
void loop()
58+
{
59+
60+
}

Diff for: keywords.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ getPositionAccuracy KEYWORD2
7676

7777
getProtocolVersionHigh KEYWORD2
7878
getProtocolVersionLow KEYWORD2
79-
getProtocolVersion KEYWORD2
79+
getProtocolVersion KEYWORD2
80+
81+
factoryReset KEYWORD2
8082

8183
#######################################
8284
# Constants (LITERAL1)

0 commit comments

Comments
 (0)