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:
- 33:2dbbe198adaf
- Parent:
- 32:aee87dcaf7ca
- Child:
- 34:0a8ae7f92262
--- a/main.cpp Mon May 13 03:44:50 2019 +0000 +++ b/main.cpp Mon May 13 09:02:19 2019 +0000 @@ -8,7 +8,7 @@ void SetMode(); void Start(); void NoHandSignal(); -int RightOrLeft = 0; + int start_state=0; int main() @@ -59,10 +59,10 @@ else if(start_state == 3) theta0 = -degree/100.0 - 90; else printf("state_error"); } - //FileOpen(); + FileOpen(); printf("LR:%d StateFlow:%d\r\n", RightOrLeft,start_state); StateFlow(start_state); - //FileClose(); + FileClose(); } void StateFlow(int i) @@ -89,10 +89,7 @@ else turn(-35.0); case 1://段差前 printf("climb!!!!!!!!!!\r\n"); - //段差乗り越え - motor_lo.setDutyLimit(0.3);//0.5 - motor_li.setDutyLimit(0.3); - + //段差乗り越え while(get_dist_forward() < 60) { if(RightOrLeft == 0) straightAndInfinity(45, 5); else straightAndInfinity(-45, 5); @@ -100,7 +97,8 @@ if(RightOrLeft == 0) phasing(45.0); else phasing(-45.0); - + motor_lo.setDutyLimit(0.3);//0.5 + motor_li.setDutyLimit(0.3); for(int i= 0; i<14; ++i) straight(); while(get_dist_back() > 80) straight(); @@ -157,6 +155,8 @@ else straightAndInfinity(90, 15); } printf("wall standby"); + motor_lo.setDutyLimit(0.3);//0.3 + motor_li.setDutyLimit(0.3); while(get_dist_back() < 250) { // straight(); if(RightOrLeft == 0) climbAndInfinity(-90,15);