ok

Dependencies:   mbed Motor

Files at this revision

API Documentation at this revision

Comitter:
mchan63
Date:
Mon Feb 18 20:41:07 2019 +0000
Commit message:
ok

Changed in this revision

Motor.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Motor.lib	Mon Feb 18 20:41:07 2019 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Motor/#f265e441bcd9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Feb 18 20:41:07 2019 +0000
@@ -0,0 +1,36 @@
+// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0)
+
+#include "mbed.h"
+#include "Motor.h"
+Motor m1(p21, p19, p20); // pwm, fwd, rev
+Motor m2(p22, p16, p15); // pwm, fwd, rev
+
+int main() {
+    while(1){
+        m1.speed(.4);
+        m2.speed(.4);
+        wait(1);
+        m1.speed(0);
+        m2.speed(0);
+        wait(1);
+        m1.speed(-.4);
+        m2.speed(-.4);
+        wait(1);
+        m1.speed(0);
+        m2.speed(0);
+        wait(1);
+        m1.speed(-.5);
+        m2.speed(.5);
+        wait(1.75);
+        m1.speed(0);
+        m2.speed(0);
+        wait(1);
+        m1.speed(.5);
+        m2.speed(-.5);
+        wait(1.75);
+        m1.speed(0);
+        m2.speed(0);
+        wait(1);
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Feb 18 20:41:07 2019 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e