xbee(ATmode/マイコン対マイコン, 衛星) なんか問題がある

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
kosukesuzuki
Date:
Thu Aug 11 15:21:46 2022 +0000
Commit message:
xbee

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 52320eec2664 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Aug 11 15:21:46 2022 +0000
@@ -0,0 +1,29 @@
+//cansat本体用のXbeeプログラミング(もし地上局でmbedを使用する場合)
+
+#include "mbed.h"
+
+Serial xbee(p13,p14);       //pin13(tx),pin14(rx)で指定
+
+char cmd = xbee.getc();
+int va1 = xbee.readable();
+
+int main() {//1
+    
+    xbee.baud(9600);
+    
+    for(;;){//2 
+        if(va1 == 1){//3
+            
+            xbee.printf("%x",cmd);            
+            
+            if(cmd == 'm'){//4
+                xbee.printf("cmd m");
+                while(1){//5
+                    
+                    
+                    }//5
+                }//4
+            }//3
+        va1 = 0;
+        }//2
+}//1
\ No newline at end of file
diff -r 000000000000 -r 52320eec2664 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Aug 11 15:21:46 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file