Jair Valdovinos
/
P3_EJ4
MADE IN RUSSIA
main.cpp@26:e119deab8c39, 2020-04-11 (annotated)
- Committer:
- thesad
- Date:
- Sat Apr 11 01:41:26 2020 +0000
- Revision:
- 26:e119deab8c39
- Parent:
- 25:c4eed8baa6d3
- Child:
- 27:d87618a1d7e0
Mis primeras practicas.1;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thesad | 26:e119deab8c39 | 1 | #include "mbed.h" |
thesad | 26:e119deab8c39 | 2 | |
thesad | 26:e119deab8c39 | 3 | Serial contador(USBTX, USBRX); |
dan | 0:7dec7e9ac085 | 4 | |
thesad | 26:e119deab8c39 | 5 | DigitalIn botom(PTA4); |
thesad | 26:e119deab8c39 | 6 | DigitalOut L1(LED1); |
thesad | 26:e119deab8c39 | 7 | DigitalOut L2(LED2); |
thesad | 26:e119deab8c39 | 8 | DigitalOut L3(LED3); |
dan | 0:7dec7e9ac085 | 9 | |
thesad | 26:e119deab8c39 | 10 | int main () |
thesad | 26:e119deab8c39 | 11 | { |
thesad | 26:e119deab8c39 | 12 | while ( 1 ) |
thesad | 26:e119deab8c39 | 13 | { |
thesad | 26:e119deab8c39 | 14 | if (botom ==1) |
thesad | 26:e119deab8c39 | 15 | { |
thesad | 26:e119deab8c39 | 16 | L1 = 0; |
thesad | 26:e119deab8c39 | 17 | L2 = 0; |
thesad | 26:e119deab8c39 | 18 | L3 = 0; |
thesad | 26:e119deab8c39 | 19 | wait(1); |
thesad | 26:e119deab8c39 | 20 | L1 = 1; |
thesad | 26:e119deab8c39 | 21 | L2 = 0; |
thesad | 26:e119deab8c39 | 22 | L3 = 0; |
thesad | 26:e119deab8c39 | 23 | wait(1); |
thesad | 26:e119deab8c39 | 24 | L1 = 0; |
thesad | 26:e119deab8c39 | 25 | L2 = 1; |
thesad | 26:e119deab8c39 | 26 | L3 = 0; |
thesad | 26:e119deab8c39 | 27 | wait(1); |
thesad | 26:e119deab8c39 | 28 | L1 = 1; |
thesad | 26:e119deab8c39 | 29 | L2 = 1; |
thesad | 26:e119deab8c39 | 30 | L3 = 0; |
thesad | 26:e119deab8c39 | 31 | wait(1); |
thesad | 26:e119deab8c39 | 32 | L1 = 0; |
thesad | 26:e119deab8c39 | 33 | L2 = 0; |
thesad | 26:e119deab8c39 | 34 | L3 = 1; |
thesad | 26:e119deab8c39 | 35 | wait(1); |
thesad | 26:e119deab8c39 | 36 | L1 = 1; |
thesad | 26:e119deab8c39 | 37 | L2 = 0; |
thesad | 26:e119deab8c39 | 38 | L3 = 1; |
thesad | 26:e119deab8c39 | 39 | |
thesad | 26:e119deab8c39 | 40 | } |
thesad | 26:e119deab8c39 | 41 | else{ |
thesad | 26:e119deab8c39 | 42 | botom==0; |
thesad | 26:e119deab8c39 | 43 | L1 = 1; |
thesad | 26:e119deab8c39 | 44 | L2 = 0; |
thesad | 26:e119deab8c39 | 45 | L3 = 1; |
thesad | 26:e119deab8c39 | 46 | wait(1); |
thesad | 26:e119deab8c39 | 47 | L1 = 0; |
thesad | 26:e119deab8c39 | 48 | L2 = 0; |
thesad | 26:e119deab8c39 | 49 | L3 = 1; |
thesad | 26:e119deab8c39 | 50 | wait(1); |
thesad | 26:e119deab8c39 | 51 | L1 = 1; |
thesad | 26:e119deab8c39 | 52 | L2 = 1; |
thesad | 26:e119deab8c39 | 53 | L3 = 0; |
thesad | 26:e119deab8c39 | 54 | wait(1); |
thesad | 26:e119deab8c39 | 55 | L1 = 0; |
thesad | 26:e119deab8c39 | 56 | L2 = 1; |
thesad | 26:e119deab8c39 | 57 | L3 = 0; |
thesad | 26:e119deab8c39 | 58 | wait(1); |
thesad | 26:e119deab8c39 | 59 | L1 = 1; |
thesad | 26:e119deab8c39 | 60 | L2 = 0; |
thesad | 26:e119deab8c39 | 61 | L3 = 0; |
thesad | 26:e119deab8c39 | 62 | wait(1); |
thesad | 26:e119deab8c39 | 63 | L1 = 0; |
thesad | 26:e119deab8c39 | 64 | L2 = 0; |
thesad | 26:e119deab8c39 | 65 | L3 = 0; |
thesad | 26:e119deab8c39 | 66 | } |
thesad | 26:e119deab8c39 | 67 | } |
thesad | 26:e119deab8c39 | 68 | } |