Nestor Pereira-Neto
/
TestePH
teste
main.cpp@0:b7a10d93aa3b, 2014-11-12 (annotated)
- Committer:
- Nestordp
- Date:
- Wed Nov 12 17:54:10 2014 +0000
- Revision:
- 0:b7a10d93aa3b
teste
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Nestordp | 0:b7a10d93aa3b | 1 | #include "mbed.h" |
Nestordp | 0:b7a10d93aa3b | 2 | |
Nestordp | 0:b7a10d93aa3b | 3 | |
Nestordp | 0:b7a10d93aa3b | 4 | DigitalOut Rele1(D2); |
Nestordp | 0:b7a10d93aa3b | 5 | DigitalOut Rele2(D3); |
Nestordp | 0:b7a10d93aa3b | 6 | DigitalOut Rele3(D4); |
Nestordp | 0:b7a10d93aa3b | 7 | DigitalOut Rele4(D5); |
Nestordp | 0:b7a10d93aa3b | 8 | |
Nestordp | 0:b7a10d93aa3b | 9 | Serial pc(USBTX, USBRX); |
Nestordp | 0:b7a10d93aa3b | 10 | |
Nestordp | 0:b7a10d93aa3b | 11 | int main() { |
Nestordp | 0:b7a10d93aa3b | 12 | |
Nestordp | 0:b7a10d93aa3b | 13 | pc.printf("comecou \n"); |
Nestordp | 0:b7a10d93aa3b | 14 | |
Nestordp | 0:b7a10d93aa3b | 15 | while(1) { |
Nestordp | 0:b7a10d93aa3b | 16 | Rele1 = !Rele1; |
Nestordp | 0:b7a10d93aa3b | 17 | pc.printf("Rele 01 \n"); |
Nestordp | 0:b7a10d93aa3b | 18 | wait_ms(1000); |
Nestordp | 0:b7a10d93aa3b | 19 | Rele2.write(1); |
Nestordp | 0:b7a10d93aa3b | 20 | pc.printf("Rele 02 \n"); |
Nestordp | 0:b7a10d93aa3b | 21 | wait_ms(1000); |
Nestordp | 0:b7a10d93aa3b | 22 | Rele3 = 0; |
Nestordp | 0:b7a10d93aa3b | 23 | pc.printf("Rele 03 \n"); |
Nestordp | 0:b7a10d93aa3b | 24 | wait_ms(1000); |
Nestordp | 0:b7a10d93aa3b | 25 | Rele4 = !Rele4; |
Nestordp | 0:b7a10d93aa3b | 26 | pc.printf("Rele 04 \n"); |
Nestordp | 0:b7a10d93aa3b | 27 | wait_ms(1000); |
Nestordp | 0:b7a10d93aa3b | 28 | } |
Nestordp | 0:b7a10d93aa3b | 29 | } |