From 5151cef035f2b03465e67d0f973b3eaebc926ec5 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Fri, 10 Jul 2020 07:15:15 +0200 Subject: [PATCH 1/2] Add missing keywords.txt --- keywords.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 keywords.txt diff --git a/keywords.txt b/keywords.txt new file mode 100644 index 0000000..7b810ae --- /dev/null +++ b/keywords.txt @@ -0,0 +1,26 @@ +####################################### +# Syntax Coloring Map for 107-Arduino-NMEA-Parser +####################################### + +####################################### +# Class (KEYWORD1) +####################################### + +ArduinoNmeaParser KEYWORD1 +Error KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +encode KEYWORD2 +clearerr KEYWORD2 +error KEYWORD2 + +####################################### +# Constants (LITERAL1) +####################################### + +None LITERAL1 +Checksum LITERAL1 +RMC LITERAL1 From 016972ae613ca08ff7ea1fd2ef276bfd0b495834 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Fri, 10 Jul 2020 07:17:57 +0200 Subject: [PATCH 2/2] Adding minimal example code to README. --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3385d9a..4fbb18c 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,33 @@ [![General Formatting Checks](https://github.com/107-systems/107-Arduino-NMEA-Parser/workflows/General%20Formatting%20Checks/badge.svg)](https://github.com/107-systems/107-Arduino-NMEA-Parser/actions?workflow=General+Formatting+Checks) [![Spell Check](https://github.com/107-systems/107-Arduino-NMEA-Parser/workflows/Spell%20Check/badge.svg)](https://github.com/107-systems/107-Arduino-NMEA-Parser/actions?workflow=Spell+Check) +Arduino library for interfacing with the PA1010D GPS module (MTK3333 chipset) and interpreting its NMEA messages. +

-Arduino library for interfacing with the PA1010D GPS module (MTK3333 chipset) and interpreting its NMEA messages. +## Example +```C++ +#include +/* ... */ +void onPositionUpdate(float const last_fix_utc_s, float const latitude, float const longitude, float const speed, float const course) +{ + char msg[64] = {0}; + snprintf(msg, 64, "[%f] %f LON | %f LAT | %d m/s | %d °", last_fix_utc_s, latitude, longitude, speed, course); + Serial.println(msg); +} +/* ... */ +ArduinoNmeaParser parser(onPositionUpdate); +/* ... */ +void setup() { + Serial.begin(9600); + Serial1.begin(9600); +} +/* ... */ +void loop() { + while (Serial1.available()) { + parser.encode((char)Serial1.read()); + } +} +```