Dependencies: PWM-Coil-driver mbed-rtos mbed
Diff: main.cpp
- Revision:
- 0:a562ecd6baab
- Child:
- 1:08a21ae747ff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jun 29 19:42:11 2017 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "rtos.h" +#include "coil-driver.h" +// Coil parameters [control pin, spike time (us), hold time period (us), hold time pulse width (us)] +Coil yellow(A0, 200, 40, 3); // Injector + +Coil orange(A1, 500, 40, 6); // Shutoff valve +DigitalOut fb(A2); // Fast shutoff circuit for shutoff valve. High when valve is off, low when valve is on. + +int main() +{ + while (true) { + orange.on(); + fb = 0; + yellow.on(); + Thread::wait(500); + orange.off(); + yellow.off(); + fb = 1; + Thread::wait(500); + } +}