F^3RC D班 / Mbed 2 deprecated clubvs2017_momoi

Dependencies:   mbed

Fork of clubvs2017_momoi by ROBOSTEP4期

Revision:
19:70657aee6fa5
Parent:
18:cab2885dc8fe
--- a/KaidaKari.cpp	Fri Jun 10 17:29:55 2016 +0000
+++ b/KaidaKari.cpp	Thu Mar 30 05:39:06 2017 +0000
@@ -95,32 +95,27 @@
 
 //motor
 
-    if((ButtonState >> BUTTONSTART)&1 == 1) {
-        flag = 0;
+    if((ButtonState >> BUTTONL2)&1 == 1) {
+        flag -= 0.1;
+        wait(0.1);
     } else if((ButtonState >> BUTTONR2)&1 == 1) {
-        flag += 0.05;
-        wait(0.1);
-    } else if((ButtonState >> BUTTONL2)&1 == 1) {
-        flag -= 0.05;
+        flag = 0;
         wait(0.1);
     }
-    if(flag >= 1.0) {
-        flag = 1.0;
-    }
-    if(flag <= -0.5) {
-        flag = 0.5;
+    if(flag <= -0.2) {
+        flag = -0.2;
     }
 
     if(LSY>140 && ((ButtonState >> BUTTONLANALOG)&1) == 1) {
-        motorRightOne = 0.8;
+        motorRightOne = 0.9;
         motorRightTwo = 0;
-        motorLeftOne = 0.8;
+        motorLeftOne = 0.9;
         motorLeftTwo = 0;
     } else if(LSY<110 && ((ButtonState >> BUTTONLANALOG)&1) == 1) {
         motorRightOne = 0;
-        motorRightTwo = 0.8;
+        motorRightTwo = 0.9;
         motorLeftOne = 0;
-        motorLeftTwo = 0.8;
+        motorLeftTwo = 0.9;
     } else if(  LSY > 140 ) { //forward
         motorRightOne = 0.6 + flag;
         motorRightTwo = 0;
@@ -140,34 +135,20 @@
     }
 
     if(( ButtonState >> BUTTONR1)&1 == 1) {
-        motorRightOne = 0.5 + flag;
+        motorRightOne = 0.7 + flag;
         motorRightTwo = 0;
         motorLeftOne = 0;
-        motorLeftTwo = 0.5 + flag;
+        motorLeftTwo = 0.7 + flag;
     }
     if(( ButtonState >> BUTTONL1)&1 == 1) {
         motorRightOne = 0;
-        motorRightTwo = 0.5 + flag;
-        motorLeftOne = 0.5 + flag;
+        motorRightTwo = 0.6 + flag;
+        motorLeftOne = 0.6 + flag;
         motorLeftTwo = 0;
     }
 
 //arm
 
-    if(  (ButtonState >> BUTTONDOWN)&1 == 1 ) {
-        armThree = 0;
-        armFour = 1;
-        armLeft = 0.8;
-    } else if( (ButtonState >> BUTTONUP)&1 == 1 ) {
-        armThree = 1;
-        armFour = 0;
-        armLeft = 0.4;
-    } else {
-        armThree = 0;
-        armFour = 0;
-        armLeft = 0;
-
-    }
 
     if((ButtonState >> BUTTONTRIANGEL)&1 == 1) {
         armOne = 1;
@@ -181,25 +162,39 @@
         armOne = 0;
         armTwo = 0;
         armRight = 0;
+    }
+
+    if(  (ButtonState >> BUTTONDOWN)&1 == 1 ) {
+        armThree = 0;
+        armFour = 1;
+        armLeft = 0.9;
+    } else if( (ButtonState >> BUTTONUP)&1 == 1 ) {
+        armThree = 1;
+        armFour = 0;
+        armLeft = 0.8;
+    } else {
+        armThree = 0;
+        armFour = 0;
+        armLeft = 0;
+
+    }
 
 
-        /*
-        With oen if, put both arms and legs.
+    /*
+    With oen if, put both arms and legs.
 
-        Use start and select??
+    Use start and select??
 
 
-        */
+    */
 
 
 
 
 
-        /*
-            led3=ButtonState & 0x0400;  //L1の状態
-            led4=ButtonState & 0x0800;  //R1の状態
-          */  //値の取得はps3.hを参照
-
-    }
+    /*
+        led3=ButtonState & 0x0400;  //L1の状態
+        led4=ButtonState & 0x0800;  //R1の状態
+      */  //値の取得はps3.hを参照
 
 }
\ No newline at end of file