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:
- 6:fe9fa8c2e6f9
- Parent:
- 5:63462d696256
- Child:
- 7:cff25545558f
--- a/main.cpp Wed May 01 00:23:43 2019 +0000 +++ b/main.cpp Wed May 01 05:45:06 2019 +0000 @@ -278,13 +278,15 @@ { setup(); + + pid_lo.setTolerance(10); pid_li.setTolerance(10); motor_lo.setEncoder(&ec_lo); motor_lo.setResolution(1000); motor_li.setEncoder(&ec_li); - motor_li.setResolution(600); + motor_li.setResolution(1000); leg_lo.setMotor(&motor_lo); leg_lo.setPIDcontroller(&pid_lo); @@ -294,8 +296,8 @@ robot.setLeg(&leg_lo, &leg_li); robot.setTickerTime(0.01); //モータ出力間隔 0.01 - motor_lo.setDutyLimit(0.1); - motor_li.setDutyLimit(0.1); + motor_lo.setDutyLimit(0.5); + motor_li.setDutyLimit(0.5); /* char str[255] = {}; @@ -304,6 +306,10 @@ printf("start!"); */ + + + + reset(); printf("bus standby\n\r"); while(1) { @@ -318,7 +324,7 @@ { straight(step_num_l, step_num_r); //printf("machine degree:%.3f\r\n", degree0); - //wait(0.01); + wait(0.01); } //turnLeft(step_num_l, step_num_r); @@ -412,12 +418,12 @@ void reset() { while(switch_lo.read()) { - motor_lo.output(0.07); + motor_lo.output(0.3); } ec_lo.reset(); motor_lo.output(0.0); while(switch_li.read()) { - motor_li.output(0.07); + motor_li.output(0.3); } ec_li.reset(); motor_li.output(0.0);