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: moves/moves.cpp
- Revision:
- 58:dc0faefeba39
- Parent:
- 57:30cd20c654d1
--- a/moves/moves.cpp Sat May 25 04:50:48 2019 +0000 +++ b/moves/moves.cpp Mon May 27 04:50:42 2019 +0000 @@ -19,10 +19,29 @@ BACK, STOP, FORWARD, + RESET, }; int step_num_l, step_num_r; void WaitAnotherLeg(); +void ResetRun() +{ + int target_step = step_num_l; + leg_lo.setTargetPose(180 + target_step*180); + leg_li.setTargetPose(180 + target_step*180); + can_send(RESET, motor_lo.getDutyLimit()); + led1 = 1; + robot.run(); + led1 = 0; + motor_lo_f.write(0); + motor_lo_b.write(0); + motor_li_f.write(0); + motor_li_b.write(0); + FileWrite(); +} + + + //収束していなければLED1をON. param:: d_step_l:左足を動かす歩数。負なら後ろに進む void Run(WalkMode mode, int d_step_l) { @@ -98,6 +117,7 @@ if(lope_count >= max_count) { // mode = STRAIGHT; is_turn = 1; + lope_count=0; } switch(mode) { case STRAIGHT: