Kohei Yamamoto
/
F303k8-toy-c-test
for20210702
Diff: main.cpp
- Revision:
- 1:fb2003e84b92
- Parent:
- 0:4bb9fdb82508
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); } }