Naoki Hasegawa
/
test2
a
Diff: test2.cpp
- Revision:
- 0:e1d7e2bd3570
- Child:
- 1:7f3cd64b15e6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test2.cpp Mon Jun 30 04:44:08 2014 +0000 @@ -0,0 +1,41 @@ +#include "mbed.h" + +DigitalOut myled(P1_14); +BusOut leds(P1_13, P1_14, P1_22, P0_17, P0_18, P0_19, P1_15, P0_1); + +void all(); +void rot(); + +int main() { + while(0x01) { + myled=0x01; + wait(0.2); + myled=0x00; + wait(0.2); + all(); + leds=0x00; + wait(0.2); + rot(); + +} +} + +void all() +{ + leds = 0x00; + wait(0.5); + leds = 0xff; + wait(0.5); +} + +void rot() +{ + int i; + for(i=0x00; i<0x08; i++){ + leds = 0x01<<i; + wait(0.2); + + } + leds=0x00; + wait(0.2); +} \ No newline at end of file