Hello world for small Sparkfun solenoid

Dependencies:   mbed

main.cpp

Committer:
4180_1
Date:
2015-10-29
Revision:
0:76a291b4c5db

File content as of revision 0:76a291b4c5db:

#include "mbed.h"
 
DigitalOut myled(LED1);
DigitalOut Ctrl(p8); //Solenoid output control bit
 
int main() {
    while(1) {
        Ctrl = 1; //ON
        myled = 1;
        wait(0.5); 
        Ctrl = 0; //OFF
        myled = 0;
        wait(2);
    }
}