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:
- 109:510927a51be8
- Parent:
- 108:d18a2beb9b9b
- Child:
- 110:cd7b7b551616
--- a/source/Movement.cpp Sat May 06 21:07:43 2017 +0000
+++ b/source/Movement.cpp Mon May 08 07:14:26 2017 +0000
@@ -372,6 +372,11 @@
case 11: // move forward
if(move_for_distance(0) < 0) {
+ //Safety Function:
+ if (getDistanceIR(2)<0.05f) {
+ stop_move();
+ search_state = 0;
+ }
stop_move();
search_state = 12;
}
