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.
Dependencies: mbed
Fork of Robocode by
Diff: source/Movement.cpp
- Revision:
- 104:7bc5eb2b4199
- Parent:
- 102:6b10685aa34d
- Child:
- 105:d489c2e8de35
--- a/source/Movement.cpp Wed May 03 09:27:27 2017 +0000
+++ b/source/Movement.cpp Wed May 03 09:56:49 2017 +0000
@@ -218,7 +218,7 @@
if((lower<0.75f)&&(lower>0.1f)) { // if something is in the range of 10 to 75cm at the lower Sensor
if(fabsf((upper-lower))>0.02f) { // and nothing is detected with the upper Sensor
stop_turn();
- search_state = 6; //brick found
+ search_state = 10; //brick found
printf("Brick found lower: %f upper:%f",lower,upper);
}
} else {
@@ -234,10 +234,6 @@
turn_for_deg(-10.0f);
search_state = 8;
break;
- case 6: // turn back right
- turn_for_deg(10.0f);
- search_state = 8;
- break;
case 8: // turn back right continue
if((lower<0.75f)&&(lower>0.1f)) { // if something is in the range of 10 to 75cm at the lower Sensor
@@ -246,7 +242,7 @@
search_state = 10; //brick found
}
} else {
- search_state = 6; // go to same state
+ search_state = 8; // go to same state
if(turn_for_deg(0) < 0) {
stop_turn();
search_state = 20; // error
