a simplistic controller to run a pump

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
sandwich
Date:
Sat Dec 14 23:54:59 2013 +0000
Commit message:
first commit

Changed in this revision

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/main.cpp	Sat Dec 14 23:54:59 2013 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+
+DigitalOut outA(p21), outB(p22);
+PwmOut pwm(p23);
+
+int main(void)
+{
+    outA=0;
+    outB=1;
+    float out=0;
+    while (1) {
+        pwm.write(out);
+        out+=0.1f;
+        if (out>=1.0f) {
+            out=0;
+        }
+        wait(0.5);
+    }
+    return 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Dec 14 23:54:59 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a842253909c9
\ No newline at end of file