código solenoide 0 e 1

Dependencies:   mbed

main.cpp

Committer:
eduardogebara
Date:
2018-05-07
Revision:
0:ad6713197fd2

File content as of revision 0:ad6713197fd2:

#include "mbed.h"

DigitalOut outcorr(D13);
bool estado = 0;

int main(){
    while(1){
        wait(2);
        estado =! estado;
        if (estado == 1){
            outcorr.write(0);
        }
        else {
            outcorr.write(1);
        }
    wait(0.2);
    }
    
}