mbed-xbee(ATmode/pc対マイコン) ,LPS35HBの統合一段階目。 cmdの初期化が問題となっている。

Dependencies:   mbed LPS25HB_I2C

Revision:
0:5ffa13919073
Child:
1:d7561bf65def
diff -r 000000000000 -r 5ffa13919073 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Aug 02 10:44:00 2022 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+
+Timer t;
+
+Serial pc(USBTX, USBRX); // tx, rx
+Serial xbee(PA_9, PA_10); // tx, rx
+
+int main() {
+    
+    pc.printf("\rbegin\r");
+ 
+    for (;;) {
+        //if (pc.readable()) xbee.putc(pc.getc());
+        if (xbee.readable()) pc.putc(xbee.getc());
+        wait_us(1);
+        
+        char cmd = xbee.getc();
+        if(cmd == 'm'){
+            pc.printf("start\r\n");
+            t.start();
+            cmd = 0;
+            }
+            
+        if(cmd == 'n'){
+            pc.printf("end\r\n");
+            pc.printf("time = %f",t.read());
+            t.stop();
+            cmd = 0;
+            return 0;
+            }
+    }
+}
\ No newline at end of file