Nuncio Perrella
/
GeoVista
Programa de Teste
Revision 0:9abb5aa73f4a, committed 2019-01-04
- Comitter:
- NPerrella
- Date:
- Fri Jan 04 13:32:18 2019 +0000
- Commit message:
- Programa de Teste
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 9abb5aa73f4a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jan 04 13:32:18 2019 +0000 @@ -0,0 +1,46 @@ +#include "mbed.h" + +int t = 0; + +DigitalOut rele_1(PC_13); // Rele 1 +DigitalOut rele_2(PC_14); // Rele 2 +DigitalIn wdt(PC_15); // Sinal de WDT do ZTE +DigitalIn chave(PA_0); // Chave de Seleção T= 4 Minutos ou T = 40 minutos + +int main() +{ + + rele_1 = 0; // Rele 1 desligado + rele_2 = 0; // Rele 2 desligado + + if(chave) + t=240; // Tempo de 4 minutos --> PA_0 --> 3V3 + else + t=2400; // Tempo de 40 minutos --> PA_0 --> GND + + wait(t); // Tempo de espera na inicialização + + while(1) + { + if(wdt) + { + rele_1 = 0; // Rele 1 desligado + rele_2 = 0; // Rele 2 desligado + } + + else + { + rele_1 = 1; // Rele 1 ligado + rele_2 = 0; // Rele 2 desligado + wait(1); // Atraso de 1 segundo + + + rele_1 = 0; // Rele 1 desligado + rele_2 = 1; // Rele 2 ligado + wait(4); // Atraso de 4 segundos + + } + + } + +}
diff -r 000000000000 -r 9abb5aa73f4a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jan 04 13:32:18 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc \ No newline at end of file