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: HCSR04 Motor mbed
Diff: main.cpp
- Revision:
- 27:96a0ff2f474c
- Parent:
- 26:5ee2a32949e6
- Child:
- 29:977f47331d85
--- a/main.cpp Sun Jun 07 16:36:03 2015 +0000
+++ b/main.cpp Sun Jun 07 17:30:06 2015 +0000
@@ -91,6 +91,7 @@
while(true) {
// Sample code to detect and object and move_forward at it
+
wait(1);
detect_o = detect_object(range, searchspeed);
@@ -103,7 +104,7 @@
detect_l = detect_line();
// If line is detected from front then reverse
- if(detect_l == 1) {
+ if(detect_l == 1 || detect_l == -1) {
stop();
turn_led_right();
reverse(searchspeed);
@@ -122,6 +123,6 @@
detect_o = 0;
stop();
- }
+ }
}