this is the demo for the dancing robot for ECE 4180

Dependencies:   Motordriver mbed

Files at this revision

API Documentation at this revision

Comitter:
macenzofan
Date:
Wed Feb 08 21:45:46 2017 +0000
Commit message:
ECE 4180 Dancing robot demo

Changed in this revision

Motordriver.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 a05a28ae0c99 Motordriver.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Motordriver.lib	Wed Feb 08 21:45:46 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/littlexc/code/Motordriver/#3110b9209d3c
diff -r 000000000000 -r a05a28ae0c99 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Feb 08 21:45:46 2017 +0000
@@ -0,0 +1,28 @@
+// test code, this demonstrates working motor drivers. 
+// full reverse to full stop, dynamicaly brake and switch off.
+#include "motordriver.h"
+Motor A(p25, p20, p19, 1); // pwm, fwd, rev, can brake 
+Motor B(p24, p18, p17, 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.02);
+    }
+    A.stop(1.0);
+    B.stop(1.0);
+    wait(1);
+    A.coast();
+    B.coast();
+    for (float s= -1.0; s < 1.0 ; s += 0.01) {
+        A.speed(s); 
+        B.speed(-s); 
+        wait(0.02);
+    }
+    A.stop(1.0);
+    B.stop(1.0);
+    wait(1);
+    A.coast();
+    B.coast();
+}
\ No newline at end of file
diff -r 000000000000 -r a05a28ae0c99 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Feb 08 21:45:46 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/176b8275d35d
\ No newline at end of file