Nucleo-F303K8とGPSモジュールを用いた緯度・経度の取得プログラム.

Dependencies:   mbed

Fork of Nucleo_GPS by Kosuke Furumoto

Revision:
1:aec45e847ec3
Parent:
0:8889ed33c550
Child:
2:ee6862d07ae9
diff -r 8889ed33c550 -r aec45e847ec3 main.cpp
--- a/main.cpp	Mon Aug 08 02:05:09 2016 +0000
+++ b/main.cpp	Tue Aug 16 15:57:35 2016 +0000
@@ -1,9 +1,10 @@
 #include "mbed.h"
- 
+
+DigitalOut myled(LED1);
 Serial gps(D1, D0);        // tx, rx
 Serial pc(USBTX, USBRX);    // tx, rx
  
-int main() {
+void pc_rx() {
 
       unsigned char c;
       int i,rlock;
@@ -54,4 +55,14 @@
         }
       }//if
     }//while
-}//main
\ No newline at end of file
+}
+
+int main(){
+    gps.attach(pc_rx,Serial::RxIrq);
+    while(1) {
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+    }
+}
\ No newline at end of file