for20210702

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
asha_ndf
Date:
Fri Jul 02 09:57:56 2021 +0000
Parent:
0:4bb9fdb82508
Commit message:
debug

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 4bb9fdb82508 -r fb2003e84b92 main.cpp
--- a/main.cpp	Thu Jul 01 12:15:17 2021 +0000
+++ b/main.cpp	Fri Jul 02 09:57:56 2021 +0000
@@ -21,18 +21,18 @@
     wait(0.25);
     led = 0;
     wait(0.25);
-    printf("\nToy-C example\n");
+    xbee.printf("\nToy-C example\n");
     while(1) {
         //Xbeeの受信
         if (xbee.readable()){
             value = xbee.getc();
-            if (value==1){//1を受信した時
+            if (value=='a'){//1を受信した時
                 nowarg = 90;
                 cnowarg = calc(nowarg);
                 servo1.pulsewidth(cnowarg);
                 servo2.pulsewidth(cnowarg);
                 led =1;
-            }else if (value ==0){
+            }else if (value =='b'){
                 nowarg = 0;//0を受信した時
                 cnowarg = calc(nowarg);
                 servo1.pulsewidth(cnowarg);
@@ -42,5 +42,6 @@
         }
         //Xbeeの送信
         xbee.printf("Status%f\r\n",nowarg);
+        wait(1);
     }
 }