GPS受信機から受信したデータをUSBを通じてPCへ転送するサンプルプログラムです。実際の所、入力デバイスはGPS受信機に限りません。

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
morimoriYNCT
Date:
Mon Dec 08 06:28:13 2014 +0000
Commit message:
????????????

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 09540e48b0da main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Dec 08 06:28:13 2014 +0000
@@ -0,0 +1,37 @@
+/**********************************
+check: OK, ublox 5T
+**********************************/
+#include "mbed.h"
+
+// serial
+Serial serial_gps(p9, p10);        // tx, rx
+Serial serial_pc(USBTX, USBRX);    // tx, rx
+
+
+void setup()
+{
+    serial_gps.baud(9600);
+    serial_pc.baud(115200);  
+    
+    serial_pc.printf("hello\n");
+    wait(3.0);  
+}
+
+void loop()
+{
+    if(serial_gps.readable())
+    {
+        //serial_pc.printf("hoge\n");
+        char c = serial_gps.getc();
+        serial_pc.printf("%c", c);
+    }
+}
+
+int main() {
+    setup();
+    
+    while(1) 
+    {   
+        loop();
+    }
+}
diff -r 000000000000 -r 09540e48b0da mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Dec 08 06:28:13 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file