Kenya Harada
/
test1
a
main.cpp@0:a1af7592b84c, 2014-05-19 (annotated)
- Committer:
- 12F2045K
- Date:
- Mon May 19 05:12:58 2014 +0000
- Revision:
- 0:a1af7592b84c
- Child:
- 1:bcd8008a4874
a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
12F2045K | 0:a1af7592b84c | 1 | #include "mbed.h" |
12F2045K | 0:a1af7592b84c | 2 | #include "math.h" |
12F2045K | 0:a1af7592b84c | 3 | BusOut myleds(P1_13, P1_14, P1_22, P0_17,P0_18,P0_19,P1_15,P0_1); |
12F2045K | 0:a1af7592b84c | 4 | |
12F2045K | 0:a1af7592b84c | 5 | int main() { |
12F2045K | 0:a1af7592b84c | 6 | while(1) { |
12F2045K | 0:a1af7592b84c | 7 | for(int i=1; i<9;i = i*2){ |
12F2045K | 0:a1af7592b84c | 8 | myleds = i; |
12F2045K | 0:a1af7592b84c | 9 | wait(0.2); |
12F2045K | 0:a1af7592b84c | 10 | } |
12F2045K | 0:a1af7592b84c | 11 | for(int i=1; i<9;i = i*2){ |
12F2045K | 0:a1af7592b84c | 12 | myleds = i*16; |
12F2045K | 0:a1af7592b84c | 13 | wait(0.2); |
12F2045K | 0:a1af7592b84c | 14 | } |
12F2045K | 0:a1af7592b84c | 15 | myleds = 0xff; |
12F2045K | 0:a1af7592b84c | 16 | wait(0.5); |
12F2045K | 0:a1af7592b84c | 17 | for(int i=1; i<9;i = i*2){ |
12F2045K | 0:a1af7592b84c | 18 | myleds = i; |
12F2045K | 0:a1af7592b84c | 19 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 20 | } |
12F2045K | 0:a1af7592b84c | 21 | myleds = 32; |
12F2045K | 0:a1af7592b84c | 22 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 23 | for(int i=8; i>1;i = i/2){ |
12F2045K | 0:a1af7592b84c | 24 | myleds = i; |
12F2045K | 0:a1af7592b84c | 25 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 26 | } |
12F2045K | 0:a1af7592b84c | 27 | for(int i=1; i<9;i = i*2){ |
12F2045K | 0:a1af7592b84c | 28 | myleds = i; |
12F2045K | 0:a1af7592b84c | 29 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 30 | } |
12F2045K | 0:a1af7592b84c | 31 | for(int i=1; i<9;i = i*2){ |
12F2045K | 0:a1af7592b84c | 32 | if(i == 2) |
12F2045K | 0:a1af7592b84c | 33 | myleds = 0; |
12F2045K | 0:a1af7592b84c | 34 | else |
12F2045K | 0:a1af7592b84c | 35 | myleds = i*16; |
12F2045K | 0:a1af7592b84c | 36 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 37 | } |
12F2045K | 0:a1af7592b84c | 38 | for(int i=8; i>1;i = i/2){ |
12F2045K | 0:a1af7592b84c | 39 | if(i == 2) |
12F2045K | 0:a1af7592b84c | 40 | myleds = 0; |
12F2045K | 0:a1af7592b84c | 41 | else |
12F2045K | 0:a1af7592b84c | 42 | myleds = i*16; |
12F2045K | 0:a1af7592b84c | 43 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 44 | } |
12F2045K | 0:a1af7592b84c | 45 | for(int i=8; i>1;i = i/2){ |
12F2045K | 0:a1af7592b84c | 46 | myleds = i; |
12F2045K | 0:a1af7592b84c | 47 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 48 | } |
12F2045K | 0:a1af7592b84c | 49 | } |
12F2045K | 0:a1af7592b84c | 50 | } |