sampleProgram

Dependencies:   QEI accelerator bit_test cyclic_io cyclic_var cylinder event_var limit mbed mecanum motor_drive pid pid_encoder rs422_put sbdbt servo

Fork of 17robo_fuzi by kusano kiyoshige

Revision:
20:347daec6c9a3
Parent:
19:76a387e4bcf6
Child:
21:6568c3587003
diff -r 76a387e4bcf6 -r 347daec6c9a3 main.cpp
--- a/main.cpp	Fri Aug 04 07:07:04 2017 +0000
+++ b/main.cpp	Fri Aug 04 23:55:22 2017 +0000
@@ -61,6 +61,7 @@
 Accel v4;
 Cylinder cylinder(pin_cylinder_on,pin_cylinder_off);
 Cyclic sword_left;
+Cyclic sword_right;
 
 //追加点
 Encoder enc_cylinder(encoder_A,encoder_B);
@@ -130,7 +131,11 @@
             counter ++;
             break;
         case 3:
-            rs422.put(id[counter], (sbdbt.sankaku*0.5-sbdbt.batu*0.5), ((float)sword_left.getState()));
+            rs422.put(id[counter], (sbdbt.sankaku*0.5-sbdbt.batu*0.5), ((float)sword_right.getState()));
+            counter ++;
+            break;
+        case 4:
+            rs422.put(id[counter], (sbdbt.up*0.5-sbdbt.down*0.5), ((float)sword_left.getState()));
             counter = 0;
             break;
         default:
@@ -139,7 +144,10 @@
 }
 
 void sword_left_cal(){
-    sword_left.cyclic(sbdbt.maru);
+    sword_left.cyclic(sbdbt.left);
+}
+void sword_right_cal(){
+    sword_right.cyclic(sbdbt.maru);
 }
 
 void cylinder_origin(){
@@ -152,7 +160,7 @@
 
 void cylinder_cal()
 {
-    cylinder.cyclic(sbdbt.up);
+    cylinder.cyclic(sbdbt.right);
 }
 
 void boost(){