Skip to content

Commit e9462a1

Browse files
authored
Update Example1_NAV_SIG.ino
Add defines for Serial2 on ESP32-WROOM
1 parent d2c714f commit e9462a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/NEO-F10N/Example1_NAV_SIG/Example1_NAV_SIG.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#include <SparkFun_u-blox_GNSS_v3.h> //http://librarymanager/All#SparkFun_u-blox_GNSS_v3
3131
SFE_UBLOX_GNSS_SERIAL myGNSS;
3232

33+
#define Serial1 Serial2 //Use Serial2 on ESP32-WROOM (RX2 = 16, TX2 = 17), this is easier to access with the IoT RedBoard - ESP32
34+
//Comment out the define if using a different microcontroller
35+
3336
// Callback: newSIG will be called when new NAV SIG data arrives
3437
// See u-blox_structs.h for the full definition of UBX_NAV_SIG_data_t
3538
// _____ You can use any name you like for the callback. Use the same name when you call setAutoNAVSIGcallback
@@ -238,7 +241,8 @@ void setup()
238241
while (!Serial); //Wait for user to open terminal
239242
Serial.println("SparkFun u-blox Example");
240243

241-
Serial1.begin(38400); // The NEO-F10N defaults to 38400 baud
244+
//Serial1.begin(38400); // The NEO-F10N defaults to 38400 baud
245+
Serial1.begin(38400, SERIAL_8N1, 16, 17); //Setup Serial port for ESP32-WROOM (RX2 = 16, TX2 = 17), make sure to Serial1 is defined as Serial2
242246

243247
//myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
244248

0 commit comments

Comments
 (0)