Marcelo Rebonatto
/
reles
Stable Version
Diff: main.cpp
- Revision:
- 0:d25d64de5666
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jul 13 20:17:27 2016 +0000 @@ -0,0 +1,40 @@ +#include "mbed.h" + +#define TEMPOLIGA 2 +#define TEMPOESPERA 1 + +int main() { + DigitalOut rele1(p21); + DigitalOut rele2(p22); + DigitalOut rele3(p23); + + wait(TEMPOESPERA); + + while(1) { + + /* + rele1=1; wait(TEMPOLIGA); + rele1=0; wait(TEMPOESPERA); + + rele2=1; wait(TEMPOLIGA); + rele2=0; wait(TEMPOESPERA); + + rele3=1; wait(TEMPOLIGA); + rele3=0; wait(TEMPOESPERA); + */ + + rele1=1; rele2=1; wait(TEMPOLIGA); + rele1=0; rele2=0; wait(TEMPOESPERA); + + rele1=1; rele3=1; wait(TEMPOLIGA); + rele1=0; rele3=0; wait(TEMPOESPERA); + + + rele3=1; rele2=1; wait(TEMPOLIGA); + rele3=0; rele2=0; wait(TEMPOESPERA); + + rele1=1; rele2=1; rele3=1; wait(TEMPOLIGA); + rele1=0; rele2=0; rele3=0; wait(TEMPOESPERA); + + } +}