メインプログラム最新版です

Dependencies:   mbed SBDBT arrc_mbed

Revision:
11:9ae7fe40a807
Parent:
10:4fe47396eb5a
Child:
12:86b5327a79c4
diff -r 4fe47396eb5a -r 9ae7fe40a807 main.cpp
--- a/main.cpp	Tue Mar 22 00:36:40 2022 +0000
+++ b/main.cpp	Thu Mar 31 09:47:57 2022 +0000
@@ -61,6 +61,7 @@
     bool auto_mode = false;
     bool status_start = 0;
     bool auto_move = 0;
+    bool field = 0;
     int r_x_component;
     int r_y_component;
     int l_x_component;
@@ -133,9 +134,11 @@
         wait_ms(2);
         if(auto_mode == true){
             if(sb.circle() == 1) {
-            count_circle++;
+                count_circle++;
             if(count_circle == 1) {
                 auto_move =! auto_move;
+                scrp.send1(BeanbagShot_num,circle_cmd,auto_move);
+                wait_ms(2);
             }
         } else {
             count_circle = 0;
@@ -143,12 +146,18 @@
             scrp.send1(wheel_num,circle_cmd,auto_move);
             wait_ms(2);
         }
-        scrp.send1(wheel_num,switch_cmd,sw1.read());
+        
+        if(sw1.read() == 1){
+            field = 0;
+        }else{
+            field = 1;
+        }
+        scrp.send1(wheel_num,switch_cmd,field);
         wait_ms(2);
 
         //ビーンバッグ回収
         if(auto_mode == false) {
-            scrp.send1(BeanbagGet_num,move,sb.square());
+            scrp.send1(TapeLed_num,1,sb.square());
             wait_ms(2);
         }
 
@@ -170,7 +179,7 @@
         if(sb.up() == 1) {
             count_up++;
             if(count_up == 1) {
-                scrp.send1(TapeLed_num,voice,1);
+                scrp.send1(TapeLed_num,voice,3);
             }
         } else {
             count_up = 0;