Grissell Esquivel
/
CuboLEDs
First wall heart
main.cpp@0:d0d0c639618c, 2016-04-11 (annotated)
- Committer:
- griszAndy
- Date:
- Mon Apr 11 00:43:37 2016 +0000
- Revision:
- 0:d0d0c639618c
First Revision Heart on one wall.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
griszAndy | 0:d0d0c639618c | 1 | #include "mbed.h" |
griszAndy | 0:d0d0c639618c | 2 | //columnas |
griszAndy | 0:d0d0c639618c | 3 | DigitalOut col1(PTA1); |
griszAndy | 0:d0d0c639618c | 4 | DigitalOut col2(PTA2); |
griszAndy | 0:d0d0c639618c | 5 | DigitalOut col3(PTD4); |
griszAndy | 0:d0d0c639618c | 6 | DigitalOut col4(PTA12); |
griszAndy | 0:d0d0c639618c | 7 | DigitalOut col5(PTA4); |
griszAndy | 0:d0d0c639618c | 8 | |
griszAndy | 0:d0d0c639618c | 9 | //filas |
griszAndy | 0:d0d0c639618c | 10 | DigitalOut floor1(PTA13); |
griszAndy | 0:d0d0c639618c | 11 | DigitalOut floor2(PTD5); |
griszAndy | 0:d0d0c639618c | 12 | DigitalOut floor3(PTD0); |
griszAndy | 0:d0d0c639618c | 13 | DigitalOut floor4(PTD2); |
griszAndy | 0:d0d0c639618c | 14 | DigitalOut floor5(PTD3); |
griszAndy | 0:d0d0c639618c | 15 | |
griszAndy | 0:d0d0c639618c | 16 | int main() { |
griszAndy | 0:d0d0c639618c | 17 | while(1) { |
griszAndy | 0:d0d0c639618c | 18 | |
griszAndy | 0:d0d0c639618c | 19 | col1 = 1; |
griszAndy | 0:d0d0c639618c | 20 | floor3 = 1; |
griszAndy | 0:d0d0c639618c | 21 | floor4 = 1; |
griszAndy | 0:d0d0c639618c | 22 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 23 | col1 = 0; |
griszAndy | 0:d0d0c639618c | 24 | floor3 = 0; |
griszAndy | 0:d0d0c639618c | 25 | floor4 = 0; |
griszAndy | 0:d0d0c639618c | 26 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 27 | |
griszAndy | 0:d0d0c639618c | 28 | col2 = 1; |
griszAndy | 0:d0d0c639618c | 29 | floor2 = 1; |
griszAndy | 0:d0d0c639618c | 30 | floor3 = 1; |
griszAndy | 0:d0d0c639618c | 31 | floor4 = 1; |
griszAndy | 0:d0d0c639618c | 32 | floor5 = 1; |
griszAndy | 0:d0d0c639618c | 33 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 34 | col2 = 0; |
griszAndy | 0:d0d0c639618c | 35 | floor2 = 0; |
griszAndy | 0:d0d0c639618c | 36 | floor3 = 0; |
griszAndy | 0:d0d0c639618c | 37 | floor4 = 0; |
griszAndy | 0:d0d0c639618c | 38 | floor5 = 0; |
griszAndy | 0:d0d0c639618c | 39 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 40 | |
griszAndy | 0:d0d0c639618c | 41 | |
griszAndy | 0:d0d0c639618c | 42 | col3 = 1; |
griszAndy | 0:d0d0c639618c | 43 | floor1 = 1; |
griszAndy | 0:d0d0c639618c | 44 | floor2 = 1; |
griszAndy | 0:d0d0c639618c | 45 | floor3 = 1; |
griszAndy | 0:d0d0c639618c | 46 | floor4 = 1; |
griszAndy | 0:d0d0c639618c | 47 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 48 | col3 = 0; |
griszAndy | 0:d0d0c639618c | 49 | floor1 = 0; |
griszAndy | 0:d0d0c639618c | 50 | floor2 = 0; |
griszAndy | 0:d0d0c639618c | 51 | floor3 = 0; |
griszAndy | 0:d0d0c639618c | 52 | floor4 = 0; |
griszAndy | 0:d0d0c639618c | 53 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 54 | |
griszAndy | 0:d0d0c639618c | 55 | |
griszAndy | 0:d0d0c639618c | 56 | col4 = 1; |
griszAndy | 0:d0d0c639618c | 57 | floor2 = 1; |
griszAndy | 0:d0d0c639618c | 58 | floor3 = 1; |
griszAndy | 0:d0d0c639618c | 59 | floor4 = 1; |
griszAndy | 0:d0d0c639618c | 60 | floor5 = 1; |
griszAndy | 0:d0d0c639618c | 61 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 62 | col4 = 0; |
griszAndy | 0:d0d0c639618c | 63 | floor2 = 0; |
griszAndy | 0:d0d0c639618c | 64 | floor3 = 0; |
griszAndy | 0:d0d0c639618c | 65 | floor4 = 0; |
griszAndy | 0:d0d0c639618c | 66 | floor5 = 0; |
griszAndy | 0:d0d0c639618c | 67 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 68 | |
griszAndy | 0:d0d0c639618c | 69 | |
griszAndy | 0:d0d0c639618c | 70 | col5 = 1; |
griszAndy | 0:d0d0c639618c | 71 | floor3 = 1; |
griszAndy | 0:d0d0c639618c | 72 | floor4 = 1; |
griszAndy | 0:d0d0c639618c | 73 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 74 | col5 = 0; |
griszAndy | 0:d0d0c639618c | 75 | floor3 = 0; |
griszAndy | 0:d0d0c639618c | 76 | floor4 = 0; |
griszAndy | 0:d0d0c639618c | 77 | wait(0.002); |
griszAndy | 0:d0d0c639618c | 78 | } |
griszAndy | 0:d0d0c639618c | 79 | } |