NHK2019ROBOCON team A manual robot program 10/4 version (ロボコン当日使用プログラム)

Dependencies:   mbed 2019ROBOKONmanualProgram

Revision:
7:59b18749a41b
Parent:
6:2675289c6463
--- a/main.cpp	Sun Oct 06 00:48:42 2019 +0000
+++ b/main.cpp	Tue Oct 08 06:25:20 2019 +0000
@@ -89,6 +89,7 @@
 int r=6;
 int s=5;
 bool x=0;
+bool y=0;
 
 
 //関数プロトタイプ宣言
@@ -696,6 +697,17 @@
             send_data(0x24,data7);
             */
             }else if(x==1){
+                data7=0xff;
+                get_data_rs232=get_data_rs232 & 0b11011111;
+                while(!(get_data_rs232 & 0x20)){
+                    send_data(0x24,data7);
+                    get_data_rs232=slave.getc();
+                }
+                data7=0x10;
+                send_data(0x24,data7);
+                x=0;
+                
+                /*
                 data_servo=0x08;
                 send_data(0x18,data_servo);
                 wait(1.2);
@@ -708,11 +720,18 @@
                 data7=0x10;
                 send_data(0x24,data7);
                 x=0;
-            
+                */
+            }
             }
-        }/*else if(triangle!=old_triangle){
+        }else if(triangle!=old_triangle){
+            old_triangle=triangle;
             if(triangle==1&&select==0){
-                                
+                if(y==0){
+                    data_servo=0x08;
+                    send_data(0x18,data_servo);
+                    y=1;
+                    //wait(1.2);
+                /*         
                 data_servo=0x07;
                 send_data(0x18,data_servo);
                 wait(1.2);
@@ -732,7 +751,14 @@
                 }
                 data7=0x10;
                 send_data(0x24,data7);
-            }*/
+                */
+                }else if(y==1){
+                    data_servo=0x07;
+                    send_data(0x18,data_servo);
+                    y=0;
+                    //wait(1.2);
+                }
+            }
         }
     }
 }