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: ContinuousServo Tach mbed
Diff: main.cpp
- Revision:
- 1:eaa66fbc27f2
- Parent:
- 0:4bc5c8484b75
--- a/main.cpp Wed Apr 25 12:44:57 2018 +0000
+++ b/main.cpp Wed Apr 25 12:56:50 2018 +0000
@@ -7,6 +7,7 @@
ContinuousServo right(p26);
AnalogOut ultra(p20);
Ticker sensor;
+float wall = 0.0;
void update() {
wall = ultra.read();
@@ -15,7 +16,7 @@
int main() {
sensor.attach(&update, .25);
- while(wall>10) {
+ while(wall>10.0) { // main code for driving goes here
left.speed(.5);
right.speed(-.5);
}