longitude correction

Fork of GPS by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
samialshorman
Date:
Tue Apr 14 21:33:33 2015 +0000
Parent:
0:15611c7938a3
Commit message:
GPS module EM-406 with mbed lpc 1768 and its application board. display the coordinates on lcd with string format and correction of longitude coordinate, based on Simon library.

Changed in this revision

GPS.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 15611c7938a3 -r 8691c80f7ef5 GPS.cpp
--- a/GPS.cpp	Tue Jun 08 14:10:27 2010 +0000
+++ b/GPS.cpp	Tue Apr 14 21:33:33 2015 +0000
@@ -47,10 +47,17 @@
                 if(ew == 'W') {    longitude *= -1.0; }
                 float degrees = trunc(latitude / 100.0f);
                 float minutes = latitude - (degrees * 100.0f);
-                latitude = degrees + minutes / 60.0f;    
-                degrees = trunc(longitude / 100.0f * 0.01f);
+                latitude = degrees + minutes / 60.0f; 
+                
+
+                               
+                                  
+                degrees = trunc(longitude / 100.0f );
                 minutes = longitude - (degrees * 100.0f);
-                longitude = degrees + minutes / 60.0f;
+                minutes=minutes / 60.0f;
+                longitude = degrees + minutes;
+                
+                                
                 return 1;
             }
         }