Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- 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++; }