PROGRAMA SIMPLE QUE LEE UNA TRAMA DE GPS Y LA PONE EN PANTALLA DE LA TERMINAL DEL PC

Dependencies:   GPS7 mbed

Fork of GPS_HelloWorld by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
tony63
Date:
Mon Apr 27 02:09:46 2015 +0000
Parent:
1:99bb5d61015f
Commit message:
cordenadas de gps en enteros para google maps

Changed in this revision

GPS.lib Show diff for this revision Revisions of this file
GPS_G.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 99bb5d61015f -r 5abd8a794703 GPS.lib
--- a/GPS.lib	Mon Oct 20 05:42:03 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://developer.mbed.org/users/tony63/code/GPS7/#df8295aa2b2b
diff -r 99bb5d61015f -r 5abd8a794703 GPS_G.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GPS_G.lib	Mon Apr 27 02:09:46 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/tony63/code/GPS7/#8d7c7165ffe2
diff -r 99bb5d61015f -r 5abd8a794703 main.cpp
--- a/main.cpp	Mon Oct 20 05:42:03 2014 +0000
+++ b/main.cpp	Mon Apr 27 02:09:46 2015 +0000
@@ -3,11 +3,15 @@
 
 Serial pc(USBTX, USBRX);
 GPS gps(PTE22, PTE23);
-
+float frac_long, frac_lat;
 int main() {
     while(1) {
         if(gps.sample()) {
-            pc.printf("I'm at %f, %f\n", gps.longitude, gps.latitude);
+            pc.printf("longitud_entera=%d, Latitud entera=%d\n", (int)gps.longitude, (int)gps.latitude);
+            frac_long=gps.longitude-(int)gps.longitude;
+            pc.printf("Longitud Fraccionaria=%d\n", (int)abs(1000000*frac_long)); 
+            frac_lat=gps.latitude-(int)gps.latitude;
+            pc.printf("Latitud fraccionaria=%d\n", (int)abs(1000000*frac_lat)); 
         } else {
             
             pc.printf("Oh Dear! No lock :(\n");