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:
- 52:dc3d83eb31eb
- Parent:
- 51:8b66c953d73a
- Child:
- 53:4673b85e1d2a
diff -r 8b66c953d73a -r dc3d83eb31eb main.cpp
--- a/main.cpp Mon May 20 03:37:02 2019 +0000
+++ b/main.cpp Mon May 20 04:26:15 2019 +0000
@@ -6,7 +6,7 @@
#include <stdlib.h>
-#define BADRULEMODE
+//#define BADRULEMODE
void StateFlow(int i);
void SetMode();
@@ -60,10 +60,10 @@
if(RightOrLeft == 0) {
if(start_state == 0) theta0 = -degree/100.0;
else if(start_state == 1) {
- theta0 = -degree/100.0 + 90;
+ theta0 = -degree/100.0 - 90;
motor_lo.setDutyLimit(0.6);//0.5
motor_li.setDutyLimit(0.6);
- turn(35.0);
+ turn(55.0);
} else if(start_state == 2) {
theta0 = -degree/100.0 - 135;
motor_lo.setDutyLimit(0.6);//0.5
@@ -74,11 +74,11 @@
} else {
if(start_state == 0) theta0 = -degree/100.0;
else if(start_state == 1) {
- theta0 = -degree/100.0 - 45;
+ theta0 = -degree/100.0 + 90;
//段差前旋回
motor_lo.setDutyLimit(0.6);//0.5
motor_li.setDutyLimit(0.6);
- turn(-35.0);
+ turn(-55.0);
} else if(start_state == 2) {
theta0 = -degree/100.0 + 135;
motor_lo.setDutyLimit(0.6);//0.5
@@ -105,7 +105,7 @@
while(checkUW(params[1].condition, degree0, ec_lo.getCount()) == 0){
straightAndInfinity(params[0].argument[0], params[0].argument[1]);
}
- printf("get distance mode");
+ printf("get distance mode\r\n");
motor_lo.setDutyLimit(params[1].duty);
motor_li.setDutyLimit(params[1].duty);
@@ -140,6 +140,7 @@
motor_lo.setDutyLimit(params[6].duty);
motor_li.setDutyLimit(params[6].duty);
+ printf("start finding back block\r\n");
while(get_dist_back() > params[6].condition) straight();
//段差後旋回