Zolovick_Larrea_Mouaffek / Mbed 2 deprecated ES202_Final_WallStop

Dependencies:   ContinuousServo Tach mbed

Files at this revision

API Documentation at this revision

Comitter:
PlayaLarrea
Date:
Wed Apr 25 13:34:02 2018 +0000
Parent:
1:eaa66fbc27f2
Child:
3:c1fe893d0353
Commit message:
update

Changed in this revision

main.cpp Show diff for this revision Revisions of this file
stop.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Apr 25 12:56:50 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#include "mbed.h"
-#include "ContinuousServo.h"
-#include "Tach.h"
-
-DigitalOut myled(LED1);
-ContinuousServo left(p23);
-ContinuousServo right(p26);
-AnalogOut ultra(p20);
-Ticker sensor;
-float wall = 0.0;
- 
-void update() {
-    wall = ultra.read();
-}
- 
-int main() {
-    sensor.attach(&update, .25);
-    
-    while(wall>10.0) { // main code for driving goes here
-    left.speed(.5);
-    right.speed(-.5);
-    }
-}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stop.cpp	Wed Apr 25 13:34:02 2018 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "ContinuousServo.h"
+#include "Tach.h"
+
+ContinuousServo left(p23);
+ContinuousServo right(p26);
+AnalogIn sonar(p20);
+Ticker ultra;
+
+float wall = 0.0;
+ 
+void update() {
+    wall = ultra.read();
+}
+ 
+int main() {
+    ultra.attach(&update, .25);
+    
+    while(wall>10.0) { // main code for driving goes here
+    left.speed(.5);
+    right.speed(-.5);
+    }
+}
\ No newline at end of file