Renato Loureiro
/
GPS_HelloWorld
Fork of GPS_HelloWorld by
Revision 2:7aabbc496ce1, committed 2014-11-26
- Comitter:
- Renato
- Date:
- Wed Nov 26 14:40:22 2014 +0000
- Parent:
- 1:b54625426fa1
- Commit message:
- vector com data
Changed in this revision
GPS.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 |
--- a/GPS.lib Fri Nov 21 17:01:28 2014 +0000 +++ b/GPS.lib Wed Nov 26 14:40:22 2014 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/Renato/code/GPS/#afffc21a3ee7 +http://developer.mbed.org/users/Renato/code/GPS/#8392585fd821
--- a/main.cpp Fri Nov 21 17:01:28 2014 +0000 +++ b/main.cpp Wed Nov 26 14:40:22 2014 +0000 @@ -4,14 +4,25 @@ Serial pc(USBTX, USBRX); GPS gps(p9, p10); +char timer[6]; +int i, hora; + int main() { while(1) { if(gps.sample()) { + pc.printf("\nI'm at %f, %f\n", gps.longitude, gps.latitude); pc.printf("Current time is %.0f\n", gps.curr_time); pc.printf("Current altitude is %.1f meters\n", gps.altitude); pc.printf("Satellites in view %d\n", gps.number_sats); pc.printf("Current precision is %.1f meters\n", gps.HDOP); + + hora = gps.curr_time; + sprintf(timer,"%d",hora); + for(i=0;i<strlen(timer);i++) + pc.printf("%c",timer[i]); + + wait(5); } else { pc.printf("Oh Dear! No lock :(\n");