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.

Name

NMEA

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 Data connection to a GPS receiver. When you plan to use only the GPRMC routines from this library, connect with NMEA(GPRMC), all sentences that are not of type GPRMC are then ignored. To use more advanced routines of this library, connect with NMEA(ALL).
Syntax
NMEA variable(connect)
Methods
decode()
gprmc_utc()
gprmc_status()
gprmc_latitude()
gprmc_longitude()
gprmc_speed()
gprmc_course()
gprmc_distance_to()
gprmc_course_to()
sentence()
terms()
term()
term_decimal()
libversion()
Parameters
connect Can be ALL or GPRMC
variable variable name referencing the object
Returns None
Usage Application
Updated on July 07, 2011 11:11:08pm PDT

Creative Commons License