Dependencies:   PWM-Coil-driver mbed-rtos mbed

main.cpp

Committer:
dmwahl
Date:
2017-06-29
Revision:
0:a562ecd6baab
Child:
1:08a21ae747ff

File content as of revision 0:a562ecd6baab:

#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);
    }
}