Kenya Harada
/
test1
a
Diff: main.cpp
- Revision:
- 0:a1af7592b84c
- Child:
- 1:bcd8008a4874
diff -r 000000000000 -r a1af7592b84c main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon May 19 05:12:58 2014 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" +#include "math.h" + BusOut myleds(P1_13, P1_14, P1_22, P0_17,P0_18,P0_19,P1_15,P0_1); + +int main() { + while(1) { + for(int i=1; i<9;i = i*2){ + myleds = i; + wait(0.2); + } + for(int i=1; i<9;i = i*2){ + myleds = i*16; + wait(0.2); + } + myleds = 0xff; + wait(0.5); + for(int i=1; i<9;i = i*2){ + myleds = i; + wait(0.1); + } + myleds = 32; + wait(0.1); + for(int i=8; i>1;i = i/2){ + myleds = i; + wait(0.1); + } + for(int i=1; i<9;i = i*2){ + myleds = i; + wait(0.1); + } + for(int i=1; i<9;i = i*2){ + if(i == 2) + myleds = 0; + else + myleds = i*16; + wait(0.1); + } + for(int i=8; i>1;i = i/2){ + if(i == 2) + myleds = 0; + else + myleds = i*16; + wait(0.1); + } + for(int i=8; i>1;i = i/2){ + myleds = i; + wait(0.1); + } + } +}