right and left move at the same time

Dependencies:   mbed robot

Revision:
12:e6fd3a3201f0
Parent:
11:0522b336eb82
Child:
13:678870d8f851
diff -r 0522b336eb82 -r e6fd3a3201f0 main.cpp
--- a/main.cpp	Wed May 08 08:45:48 2019 +0000
+++ b/main.cpp	Wed May 15 06:49:13 2019 +0000
@@ -8,13 +8,13 @@
     FORWARD,
 };
 enum EVENT {
-    NORMAL,
-    GEREGE,
+    G_OPEN,
+    G_CLOSE,
     GOAL,
 };
 
 float accel_max = 0.01; //これグローバルにしたのはごめん。set関数多すぎてめんどくなった。
-int hand_mode=NORMAL;
+int hand_mode=G_CLOSE;
 
 void setup();
 void forward();
@@ -41,6 +41,12 @@
 {
     printf("standby ok\n\r");
     setup();
+    
+    /*while(1){
+        servo.set_degree(0,(7200 - 3500) * 270.0/(11500 - 3500));
+        wait(0.01);
+        printf("servo");
+    }*/
     pid_ro.setTolerance(10);
     pid_ri.setTolerance(10);
 
@@ -74,7 +80,10 @@
         printf("mode:%d duty:%.3f\n\r", mode, duty);
         motor_ro.setDutyLimit(duty);
         motor_ri.setDutyLimit(duty);
-        if(hand_mode == GEREGE) {
+        if(hand_mode == G_OPEN) {
+            air_hand = 1;
+        }
+        else if(hand_mode == G_CLOSE) {
             air_hand = 0;
 
         } else if(hand_mode == GOAL) {