107-Arduino-NMEA-Parser
Arduino library for interfacing with any GPS, GLONASS, Galileo or GNSS module and interpreting its NMEA messages.
This library works for
Arduino Zero
, MKR 1000
, MKR WiFi 1010
, Nano 33 IoT
, MKR GSM 1400
, MKR NB 1500
, MKR WAN 1300/1310
:heavy_check_mark:Portenta H7
, Nano 33 BLE
, Nano RP2040 Connect
, Edge Control
:heavy_check_mark:ESP32 Dev Module
, ESP32 Wrover Module
, ... :heavy_check_mark:Portenta C33
, Uno R4 WiFi
, Uno R4 Minima
, ... :heavy_check_mark:#include <ArduinoNmeaParser.h>
/* ... */
void onRmcUpdate(nmea::RmcData const rmc)
{
Serial.print(rmc.time_utc.hour);
Serial.print(":");
Serial.print(rmc.time_utc.minute);
Serial.print(":");
Serial.print(rmc.time_utc.second);
Serial.print(".");
Serial.print(rmc.time_utc.microsecond);
if (rmc.is_valid)
{
Serial.print(" : LON ");
Serial.print(rmc.longitude);
Serial.print(" ° | LAT ");
Serial.print(rmc.latitude);
Serial.print(" ° | VEL ");
Serial.print(rmc.speed);
Serial.print(" m/s | HEADING ");
Serial.print(rmc.course);
Serial.print(" °");
}
Serial.println();
}
/* ... */
ArduinoNmeaParser parser(onRmcUpdate, nullptr);
/* ... */
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
}
/* ... */
void loop() {
while (Serial1.available()) {
parser.encode((char)Serial1.read());
}
}