schneider françois
/
Test_gps_sample
OK
main.cpp
- Committer:
- schnf30
- Date:
- 2016-05-01
- Revision:
- 0:5cddc7863ae6
- Child:
- 1:828c32336aa2
File content as of revision 0:5cddc7863ae6:
#include "mbed.h" #include "Sf_gps.h" Gps gps(USBTX, USBRX); #define gps_event // pour utiliser en mode event. #ifdef gps_event void Gps_attache() { gps.receive(); } #endif int main() { gps.printf("Hello, I'm Ok\r\n"); #ifdef gps_event gps.attach(&Gps_attache, Serial::RxIrq); #endif while(1) { #ifndef gps_event gps.receive(); #endif if (gps.gps_data_ok()) gps.printf("Receive %f, %f, %c ,%f ,%c ,%d, %d\r\n",gps.time(),gps.latitude(),gps.ns(),gps.longitude(),gps.ew(),gps.lock(),gps.nbsattelite()); } }