![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork of GPS_HelloWorld by
main.cpp
- Committer:
- Renato
- Date:
- 2014-11-26
- Revision:
- 2:7aabbc496ce1
- Parent:
- 1:b54625426fa1
File content as of revision 2:7aabbc496ce1:
#include "mbed.h" #include "GPS.h" 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"); } } }