ROBOSTEP_5期 / Mbed 2 deprecated George_Master_Param

Dependencies:   mbed robot

Revision:
8:ded0354412ae
Parent:
7:cff25545558f
Child:
9:e248986c8423
--- a/main.cpp	Wed May 01 06:41:39 2019 +0000
+++ b/main.cpp	Wed May 01 07:41:15 2019 +0000
@@ -348,7 +348,7 @@
 }
 void turnLeft(int &step_num_l, int &step_num_r)
 {
-    can_send(360+step_num_r*180,180+step_num_r*180);
+    can_send(step_num_r,step_num_r);
     leg_lo.setTargetPose(360+(step_num_l-2)*180);
     leg_li.setTargetPose(180+(step_num_l-2)*180);
     robot.run();
@@ -364,9 +364,9 @@
 }
 void turnRight(int &step_num_l, int &step_num_r)
 {
-    can_send(360+step_num_r*180,180+step_num_r*180);
-    leg_lo.setTargetPose(360+(step_num_l-1)*180);
-    leg_li.setTargetPose(180+(step_num_l-1)*180);
+    can_send(step_num_r-2,step_num_r-2);
+    leg_lo.setTargetPose(360+step_num_l*180);
+    leg_li.setTargetPose(180+step_num_l*180);
     robot.run();
     motor_lo_f.write(0);
     motor_lo_b.write(0);
@@ -375,7 +375,8 @@
     while(1) {
         if(bus_in.read() == 1) break;
     }
-    
+    step_num_r--;
+    step_num_l++;
 }