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 | gprmc_status() |
Examples | #include <nmea.h> // create a GPS data connection to GPRMC sentence type NMEA gps(GPRMC); void setup() { Serial1.begin(4800); pinMode(8, OUTPUT); } void loop() { if (Serial1.available() > 0 ) { // read incoming character from GPS char c = Serial1.read(); // check if the character completes a valid GPS sentence if (gps.decode(c)) { // check if GPS positioning was active if (gps.gprmc_status() == 'A') { // check if you are in Colorado, USA boolean inColorado = (gps.gprmc_latitude() > 37.0) && (gps.gprmc_latitude() < 41.0) && (gps.gprmc_longitude() < -102.05) && (gps.gprmc_longitude() > -109.05); // set led accordingly if (inColorado) { digitalWrite(8, HIGH); } else { digitalWrite(8, LOW); } } } } } |
Description | Returns status character of the last GPRMC sentence received. The status character can be 'A' (for Active) or 'V' (for Void), and signals whether the GPS was active when the positioning was made. If it is void, the GPS could not make a good positioning and you should ignore it, which usually occurs when the GPS is still searching for satellites. |
Syntax | gprmc_status() |
Returns | char |
Usage | Application |