Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #include "GPS.h" 00003 00004 Serial pc(USBTX, USBRX); 00005 GPS gps(p13, p14); 00006 00007 int main() { 00008 pc.printf("start main\r\n"); 00009 while(1) { 00010 //wait(0.1); 00011 //pc.printf("\nHello world\n\r"); 00012 //printf ("\n\r the value of GPS sample is : %d\n\r", gps.sample()); 00013 if(gps.sample()) { 00014 pc.printf("I'm at %f, %f\n\r", gps.longitude, gps.latitude); 00015 //pc.printf("good\r\n"); 00016 } else { 00017 pc.printf("Oh Dear! No lock :(\n\r"); 00018 //pc.printf("bad\r\n"); 00019 } 00020 } 00021 } 00022 00023 00024 /* 00025 $GPRMC,000115.039,V,,,,,,,291006,,*2C 00026 $GPGGA,000116.031,,,,,0,00,,,M,0.0,M,,0000*52 00027 $GPGSA,A,1,,,,,,,,,,,,,,,*1E 00028 $GPGSV,3,1,12,20,00,000,,10,00,000,,31,00,000,,27,00,000,*7C 00029 $GPGSV,3,2,12,19,00,000,,07,00,000,,04,00,000,,24,00,000,*76 00030 $GPGSV,3,3,12,16,00,000,,28,00,000,,26,00,000,,29,00,000,*78 00031 $GPRMC,000116.031,V,,,,,,,291006,,*27 00032 $GPGGA,000117.035,,,,,0,00,,,M,0.0,M,,0000*57 00033 $GPGSA,A,1,,,,,,,,,,,,,,,*1E 00034 $GPRMC,000117.035,V,,,,,,,291006,,*22 00035 $GPGGA,000118.039,,,,,0,00,,,M,0.0,M,,0000*54 00036 $GPGSA,A,1,,,,,,,,,,,,,,,*1E 00037 $GPRMC,000118.039,V,,,,,,,291006,,*21 00038 $GPGGA,000119.035,,,,,0,00,,,M,0.0,M,,0000*59 00039 $GPGSA,A,1,,,,,,,,,,,,,,,*1E 00040 $GPRMC,000119.035,V,,,,,,,291006,,*2C 00041 $GPGGA,000120.037,,,,,0,00,,,M,0.0,M,,0000*51 00042 $GPGSA,A,1,,,,,,,,,,,,,,,*1E 00043 $GPRMC,000120.037,V,,,,,,,291006,,*24 00044 */
Generated on Mon Jul 18 2022 22:51:15 by
1.7.2