Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.
Class | NMEA |
---|---|
Name | sentence() |
Examples | #include <nmea.h> NMEA gps(ALL); // GPS data connection to all sentence types void setup() { Serial.begin(9600); Serial1.begin(4800); } void loop() { if (Serial1.available() > 0 ) { // read incoming character from GPS and feed it to NMEA type object if (gps.decode(Serial1.read())) { // full sentence received Serial.print ("Sentence = "); Serial.println (gps.sentence()); Serial.print ("Datatype = "); Serial.println (gps.term(0)); Serial.print ("Number of terms = "); Serial.println (gps.terms()); } } } |
Description | Returns the last sentence that was received. The sentence is returned as a zero-terminated sequence of characters. If the connection type is NMEA(ALL), all sentence types are received. If the connection type is NMEA(GPRMC), only sentences of type GPRMC are received. |
Syntax | sentence() |
Returns | char * |
Usage | Application |