Libraries \ NMEA

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

terms()

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 number of terms in the last sentence that was received. This includes the datatype term, the checksum term, and possibly empty terms. For example, if the last sentence received was $GPRMC,082804.683,A,5205.9421,N,00506.4368,E,0.02,146.61,190408,,*0C then the number of terms is 13 (note the two empty terms just before the '*'). 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
terms()
Returns int
Usage Application
Updated on July 07, 2011 11:11:13pm PDT

Creative Commons License