PROGRAMA SIMPLE QUE LEE UNA TRAMA DE GPS Y LA PONE EN PANTALLA DE LA TERMINAL DEL PC
Fork of GPS_HelloWorld by
Revision 2:5abd8a794703, committed 2015-04-27
- 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
--- 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
--- /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
--- 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");