Feb 8, 2019
39519 views
5 respects
Components and supplies
RS422 / RS485 Shield
Arduino UNO
Project description
Code
NMEA 0183 demo
arduino
Parsing NMEA 0183 protocols
1#include <NMEA0183.h> 2 3// matches Zihatec RS422/RS485 shield 4SoftwareSerial gps(2, 3); 5NMEA0183 nmea; 6 7void setup() 8{ 9 while (!Serial); 10 Serial.begin(115200); 11 gps.begin(4800); 12 Serial.println("NMEA0183 parser test"); 13} 14 15void loop() 16{ 17 if (gps.available()) 18 { 19 char c = gps.read(); 20 if (nmea.update(c)) 21 { 22 Serial.print("NMEA0183 sentence accepted ("); 23 Serial.print(nmea.getFields()); 24 Serial.print(" fields): "); 25 Serial.write(nmea.getSentence()); 26 Serial.println(); 27 } 28 } 29}
Comments
Only logged in users can leave comments
hwhardsoft
0 Followers
0 Projects
Table of contents
Intro
5
0