Skip to content

Commit f54547f

Browse files
committed
Reorder examples
1 parent b48c627 commit f54547f

File tree

16 files changed

+87
-18
lines changed

16 files changed

+87
-18
lines changed

examples/Example15_QueryDevice/Example15_QueryDevice.ino renamed to examples/Example16_QueryDevice/Example16_QueryDevice.ino

+12-16
Original file line numberDiff line numberDiff line change
@@ -53,32 +53,28 @@ void setup()
5353
//Turn off all NMEA, RTCM, and any other message that may be reporting periodically
5454
myGNSS.disableOutput();
5555

56-
char response[1000] = {0};
57-
int responseLength = sizeof(response);
56+
Serial.print("Model Type: ");
57+
Serial.print(myGNSS.getModelType());
58+
Serial.println();
5859

60+
Serial.print("Unique Module ID: ");
61+
Serial.print(myGNSS.getID());
5962
Serial.println();
60-
responseLength = sizeof(response);
61-
myGNSS.sendQuery("MASK", response, &responseLength);
62-
Serial.printf("Mask response (%d bytes): \r\n%s\r\n", responseLength, response);
6363

64-
//The config query can be more than 700 bytes
64+
Serial.print("Firmware Version: ");
65+
Serial.print(myGNSS.getVersion());
6566
Serial.println();
66-
responseLength = sizeof(response);
67-
myGNSS.sendQuery("CONFIG", response, &responseLength);
68-
Serial.printf("Config response (%d bytes): \r\n%s\r\n", responseLength, response);
6967

68+
Serial.print("Firmware Compile Time: ");
69+
Serial.print(myGNSS.getCompileTime());
7070
Serial.println();
71-
responseLength = sizeof(response);
72-
myGNSS.sendQuery("MODE", response, &responseLength);
73-
Serial.printf("Mode response (%d bytes): \r\n%s\r\n", responseLength, response);
7471

72+
Serial.print("Full Version Report: ");
73+
Serial.print(myGNSS.getVersionFull());
7574
Serial.println();
76-
responseLength = sizeof(response);
77-
myGNSS.sendQuery("VERSION", response, &responseLength);
78-
Serial.printf("Version response (%d bytes): \r\n%s\r\n", responseLength, response);
7975
}
8076

8177
void loop()
8278
{
8379
if (Serial.available()) ESP.restart();
84-
}
80+
}

examples/Example1_PositionVelocityTime/Example1_PositionVelocityTime.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
SparkFun Triband GNSS RTK Breakout - UM980 (GPS-23286) https://www.sparkfun.com/products/23286
1717
1818
Hardware Connections:
19-
Connect RX2 of the UM980 to pin 4 on the ESP32
20-
Connect TX2 of the UM980 to pin 13 on the ESP32
19+
Connect RX2 (green wire) of the UM980 to pin 4 on the ESP32
20+
Connect TX2 (orange wire) of the UM980 to pin 13 on the ESP32
2121
To make this easier, a 4-pin locking JST cable can be purchased here: https://www.sparkfun.com/products/17240
2222
Note: Almost any ESP32 pins can be used for serial.
2323
Connect a dual or triband GNSS antenna: https://www.sparkfun.com/products/21801
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
Echo all characters to the serial terminal.
3+
By: Nathan Seidle
4+
SparkFun Electronics
5+
Date: October 2nd, 2023
6+
License: MIT. Please see LICENSE.md for more information.
7+
8+
This sketch simply echoes chars coming from the UM980 and sends chars
9+
to the UM980. This allows a user to directly enter command strings into the UM980
10+
while still connected to the Arduino. Good for viewing raw output from a given command.
11+
12+
For example, type CONFIG to see the module's current configuration response.
13+
14+
These examples are targeted for an ESP32 platform but any platform that has multiple
15+
serial UARTs should be compatible.
16+
17+
Feel like supporting open source hardware?
18+
Buy a board from SparkFun!
19+
SparkFun Triband GNSS RTK Breakout - UM980 (GPS-23286) https://www.sparkfun.com/products/23286
20+
21+
Hardware Connections:
22+
Connect RX2 of the UM980 to pin 4 on the ESP32
23+
Connect TX2 of the UM980 to pin 13 on the ESP32
24+
To make this easier, a 4-pin locking JST cable can be purchased here: https://www.sparkfun.com/products/17240
25+
Note: Almost any ESP32 pins can be used for serial.
26+
Connect a dual or triband GNSS antenna: https://www.sparkfun.com/products/21801
27+
*/
28+
29+
int pin_UART1_TX = 4;
30+
int pin_UART1_RX = 13;
31+
32+
#include <SparkFun_Unicore_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_Unicore_GNSS
33+
34+
UM980 myGNSS;
35+
36+
HardwareSerial SerialGNSS(1); //Use UART1 on the ESP32
37+
38+
void setup()
39+
{
40+
Serial.begin(115200);
41+
delay(250);
42+
Serial.println();
43+
Serial.println("SparkFun UM980 Example");
44+
45+
//We must start the serial port before using it in the library
46+
SerialGNSS.begin(115200, SERIAL_8N1, pin_UART1_RX, pin_UART1_TX);
47+
48+
//myGNSS.enableDebugging(); // Print all debug to Serial
49+
50+
if (myGNSS.begin(SerialGNSS) == false) //Give the serial port over to the library
51+
{
52+
Serial.println("UM980 failed to respond. Check ports and baud rates. Freezing...");
53+
while (true);
54+
}
55+
Serial.println("UM980 detected!");
56+
57+
bool response = true;
58+
59+
//Turn off all NMEA, RTCM, and any other message that may be reporting periodically
60+
response &= myGNSS.disableOutput();
61+
62+
Serial.println("All characters now being echoed to UM980");
63+
Serial.println("Be sure both NL & CR is turned on!");
64+
}
65+
66+
void loop()
67+
{
68+
while(SerialGNSS.available())
69+
Serial.write(SerialGNSS.read());
70+
71+
while(Serial.available())
72+
SerialGNSS.write(Serial.read());
73+
}

0 commit comments

Comments
 (0)