unedited

Dependencies:   Motordriver mbed

Files at this revision

API Documentation at this revision

Comitter:
kit3
Date:
Sat May 18 04:37:36 2013 +0000
Commit message:
OBSTACLE AVOIDING ROBOT USING ULTRASONIC SENSOR

Changed in this revision

Motordriver1.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 53dd64d2eabd Motordriver1.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Motordriver1.lib	Sat May 18 04:37:36 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/littlexc/code/Motordriver/#3110b9209d3c
diff -r 000000000000 -r 53dd64d2eabd main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat May 18 04:37:36 2013 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "motordriver.h"
+Motor A(p22, p6, p5, 1); // pwm, fwd, rev, can brake 
+Motor B(p21, p7, p8, 1); // pwm, fwd, rev, can brake
+int main() 
+{ 
+   
+    //for (float s= -1.0; s < 1.0 ; s += 0.01)
+     //{
+       // A.speed(s); 
+        //B.speed(s); 
+        //wait(0.01);
+    //}
+    
+    //A.coast();
+    //B.coast();
+    //void right();
+    while(1)
+    {
+    A.speed(1.0);
+    B.speed(1.0);
+    wait (2);
+    
+    A.speed(-1.0);
+    B.speed(-1.0);
+    }
+    //void left();
+}
+
+void right()
+{
+A.speed(1.0);
+B.speed(-1.0);
+}
+
+void left()
+{
+A.speed(-1.0);
+B.speed(1.0);
+}
\ No newline at end of file
diff -r 000000000000 -r 53dd64d2eabd mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat May 18 04:37:36 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b
\ No newline at end of file