OK

Dependencies:   gps_sample mbed

Revision:
1:828c32336aa2
Parent:
0:5cddc7863ae6
Child:
3:9f6d26f044c7
--- a/main.cpp	Sun May 01 19:43:44 2016 +0000
+++ b/main.cpp	Mon May 02 19:54:59 2016 +0000
@@ -1,25 +1,29 @@
 #include "mbed.h"
 #include "Sf_gps.h"
 
-Gps gps(USBTX, USBRX);
-
+Gps gps(p9,p10);
+Serial pc(USBTX, USBRX);
+DigitalOut myled(LED1);
 #define gps_event // pour utiliser en mode event.
 
 #ifdef gps_event
-void Gps_attache() {
-     gps.receive();
-      }
+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       
+
+int main()
+{
+    pc.baud(9600);
+    pc.printf("Hello, I'm Ok\r\n");
+#ifdef gps_event
+    gps.attach(&Gps_attache, Serial::RxIrq);
+#endif
     while(1) {
-        #ifndef gps_event  
+#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());   
-         }
+#endif
+        if (gps.gps_data_ok()) pc.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());
     }
+}