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:
- 2:f9ec340630b0
- Parent:
- 1:497b52a2d414
- Child:
- 3:1db119f74ecb
diff -r 497b52a2d414 -r f9ec340630b0 main.cpp
--- a/main.cpp Thu Jun 22 14:52:57 2017 +0000
+++ b/main.cpp Thu Jun 22 15:08:07 2017 +0000
@@ -63,17 +63,20 @@
// number is negative when the line is to the left. Need to turn left
if (position < threshold) {
// slow down left, speed up right
- robot.motors(speed-power,speed+power);
+
+ // ADD CODE HERE TO CONTROL MOTORS
}
// number is positive when the line is to the right. Need to turn right
else if (position > threshold) {
// slow down right, speed up left
- robot.motors(speed+power,speed-power);
+
+ // ADD CODE HERE TO CONTROL MOTORS
}
// else over the line
else {
// drive straight ahead
- robot.motors(speed,speed);
+
+ // ADD CODE HERE TO CONTROL MOTORS
}
// wait for a short time before repeating the loop