nmea gps library - without any serial

Dependents:   HARP2 HARP3 20180621_FT813

Fork of GPS_parser by Tyler Weaver

NMEA GPS Serial Output parser.

Routine taken from NMEA Software Standard (NMEA 0183) http://www.winsystems.com/software/nmea.pdf

Only handles GGA and RMC Messages

Files at this revision

API Documentation at this revision

Comitter:
tylerjw
Date:
Fri Nov 23 21:16:27 2012 +0000
Parent:
1:39d75e44b214
Child:
3:465354a08ff8
Commit message:
fixed bug; Kentucky windage on heading calculation... fix

Changed in this revision

GPS.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/GPS.cpp	Fri Nov 23 19:57:17 2012 +0000
+++ b/GPS.cpp	Fri Nov 23 21:16:27 2012 +0000
@@ -80,7 +80,7 @@
             line_parsed = GGA;
         }
         // Check if it is a GPRMC msg
-        else if (sscanf(msg, "GPRMC,%f,%c,%f,%c,%f,%f,%d", &utc_time, &ns, &nmea_longitude, &ew, &speed_k, &course_d, &date) >= 1) {
+        else if (sscanf(msg, "GPRMC,%f,%f,%c,%f,%c,%f,%f,%d", &utc_time, &nmea_latitude, &ns, &nmea_longitude, &ew, &speed_k, &course_d, &date) >= 1) {
             line_parsed = RMC;
         }
         // GLL - Geographic Position-Lat/Lon
@@ -232,7 +232,7 @@
     double dlong = abs(pontLong - get_dec_longitude()) * d2r;
     double y = sin(dlong) * cos(pointLat * d2r);
     double x = cos(get_dec_latitude()*d2r)*sin(pointLat*d2r) - sin(get_dec_latitude()*d2r)*cos(pointLat*d2r)*cos(dlong);
-    return atan2(y,x)*r2d;
+    return 360.0-(atan2(y,x)*r2d);
 }    
 
 /*