Search wiring.org.co:

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 |

### term()

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 a specific term from the last sentence that was received. The term is returned as a zero-terminated sequence of characters. 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 gps.term(7) returns "0.02". Note that the terms are numbered starting with zero. 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 |
    term(num)
Parameters |

num | int

Returns | char *
Usage | Application

Updated on July 07, 2011 11:11:13pm PDT