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:
- 7:cff25545558f
- Parent:
- 6:fe9fa8c2e6f9
- Child:
- 8:ded0354412ae
--- a/main.cpp Wed May 01 05:45:06 2019 +0000 +++ b/main.cpp Wed May 01 06:41:39 2019 +0000 @@ -286,7 +286,7 @@ motor_lo.setEncoder(&ec_lo); motor_lo.setResolution(1000); motor_li.setEncoder(&ec_li); - motor_li.setResolution(1000); + motor_li.setResolution(600); leg_lo.setMotor(&motor_lo); leg_lo.setPIDcontroller(&pid_lo); @@ -296,8 +296,8 @@ robot.setLeg(&leg_lo, &leg_li); robot.setTickerTime(0.01); //モータ出力間隔 0.01 - motor_lo.setDutyLimit(0.5); - motor_li.setDutyLimit(0.5); + motor_lo.setDutyLimit(0.3); + motor_li.setDutyLimit(0.3); /* char str[255] = {}; @@ -332,7 +332,7 @@ } void straight(int &step_num_l, int &step_num_r) { - can_send(360+step_num_r*180,180+step_num_r*180); + can_send((float)step_num_r,(float)step_num_r); leg_lo.setTargetPose(360+step_num_l*180); leg_li.setTargetPose(180+step_num_l*180); robot.run(); @@ -343,7 +343,8 @@ while(1) { if(bus_in.read() == 1) break; } - step_num_l = step_num_r ++; + step_num_l++; + step_num_r++; } void turnLeft(int &step_num_l, int &step_num_r) {