nmea gps library - without any serial
Fork of GPS by
Diff: GPS.cpp
- Revision:
- 2:682663c5b1ee
- Parent:
- 0:3611af72bfd7
- Child:
- 3:465354a08ff8
--- 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); } /*