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 00002 #include "mbed.h" 00003 00004 #include "GroveGPS.h" 00005 00006 Serial gps_serial(p9, p10, 9600); 00007 Serial pc(USBTX, USBRX); //Initialise une liason série via le connecteur USB du pc 00008 00009 Thread gpsThread; 00010 GroveGPS gps; 00011 00012 // Runs at 1Hz and updates the GPS location every second 00013 void gps_updater_thread() { 00014 char i; 00015 while(true) { 00016 char latBuffer[16], lonBuffer[16]; 00017 gps.getLatitude(latBuffer); 00018 gps.getLongitude(lonBuffer); 00019 00020 // Utilize latitude and longitude values here 00021 pc.printf("Latitude: %s, Longitude: %s\n\r", latBuffer, lonBuffer); 00022 /*for(i=0;i<16;i++) 00023 { 00024 pc.printf("%c ",latBuffer[i]); 00025 } 00026 pc.printf("\n\r");*/ 00027 wait(1); 00028 } 00029 } 00030 00031 int main() { 00032 00033 pc.baud(115200);//Initialise la vitesse de la communication série 00034 00035 // Start a thread to get updated GPS values 00036 gpsThread.start(gps_updater_thread); 00037 00038 // Read the serial bus to get NMEA GPS details 00039 while (true) { 00040 if (gps_serial.readable()) { 00041 gps.readCharacter(gps_serial.getc()); 00042 } 00043 } 00044 00045 return 0; 00046 }
Generated on Thu Aug 4 2022 10:05:30 by
1.7.2