Kenya Harada
/
test1
a
main.cpp@1:bcd8008a4874, 2014-05-19 (annotated)
- Committer:
- 12F2045K
- Date:
- Mon May 19 05:18:29 2014 +0000
- Revision:
- 1:bcd8008a4874
- Parent:
- 0:a1af7592b84c
b
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 | myleds = 0xff; |
12F2045K | 0:a1af7592b84c | 8 | wait(0.5); |
12F2045K | 0:a1af7592b84c | 9 | for(int i=1; i<9;i = i*2){ |
12F2045K | 0:a1af7592b84c | 10 | myleds = i; |
12F2045K | 0:a1af7592b84c | 11 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 12 | } |
12F2045K | 0:a1af7592b84c | 13 | myleds = 32; |
12F2045K | 0:a1af7592b84c | 14 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 15 | for(int i=8; i>1;i = i/2){ |
12F2045K | 0:a1af7592b84c | 16 | myleds = i; |
12F2045K | 0:a1af7592b84c | 17 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 18 | } |
12F2045K | 0:a1af7592b84c | 19 | for(int i=1; i<9;i = i*2){ |
12F2045K | 0:a1af7592b84c | 20 | myleds = i; |
12F2045K | 0:a1af7592b84c | 21 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 22 | } |
12F2045K | 0:a1af7592b84c | 23 | for(int i=1; i<9;i = i*2){ |
12F2045K | 0:a1af7592b84c | 24 | if(i == 2) |
12F2045K | 0:a1af7592b84c | 25 | myleds = 0; |
12F2045K | 0:a1af7592b84c | 26 | else |
12F2045K | 0:a1af7592b84c | 27 | myleds = i*16; |
12F2045K | 0:a1af7592b84c | 28 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 29 | } |
12F2045K | 1:bcd8008a4874 | 30 | for(int i=8; i>0;i = i/2){ |
12F2045K | 0:a1af7592b84c | 31 | if(i == 2) |
12F2045K | 0:a1af7592b84c | 32 | myleds = 0; |
12F2045K | 0:a1af7592b84c | 33 | else |
12F2045K | 0:a1af7592b84c | 34 | myleds = i*16; |
12F2045K | 0:a1af7592b84c | 35 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 36 | } |
12F2045K | 0:a1af7592b84c | 37 | for(int i=8; i>1;i = i/2){ |
12F2045K | 0:a1af7592b84c | 38 | myleds = i; |
12F2045K | 0:a1af7592b84c | 39 | wait(0.1); |
12F2045K | 0:a1af7592b84c | 40 | } |
12F2045K | 0:a1af7592b84c | 41 | } |
12F2045K | 0:a1af7592b84c | 42 | } |