Demonstrates the use of two pumps using Hbridge

Dependencies:   Motor mbed

Revision:
0:296f37bd5ce3
diff -r 000000000000 -r 296f37bd5ce3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 01 00:30:40 2017 +0000
@@ -0,0 +1,24 @@
+// Demonstrates the use of two pumps using Hbridge, utilizes the forward and 
+// reverse functionality to dispense one drink or the other. This code 
+// starts one pump for 3 seconds then turns it off then starts the second
+// pump for 3 seconds and turns it off. Then both pumps remain off for 3 seconds
+// then the system repeats the process.
+
+#include "mbed.h"
+#include "Motor.h"
+DigitalIn stby(p25);
+Motor pump(p26, p13, p14);  // pwm, fwd, rev (H-bridge)
+
+
+int main() {
+        stby.mode(PullUp);
+        while(1){
+        pump.speed(1);      // Drink 1 dispenses
+        wait(3);
+        pump.speed(-1);     // Drink 2 dispenses
+        wait(3);
+        pump.speed(0);      // pumps are stopped
+        wait(3);
+        }
+}
+