masamitsu shibata
/
test5
homework
Diff: main.cpp
- Revision:
- 1:3917701817b4
- Parent:
- 0:5193eafa81b6
- Child:
- 2:46e449180029
diff -r 5193eafa81b6 -r 3917701817b4 main.cpp --- a/main.cpp Fri Apr 11 10:50:46 2014 +0000 +++ b/main.cpp Mon Apr 21 07:00:37 2014 +0000 @@ -3,16 +3,34 @@ BusOut leds(P1_13, P1_14, P1_22, P0_17, P0_18, P0_19, P1_15, P0_1); void rotate(); +void all(); +void sitei(); int main() { while(1) { - rotate(); + rotate(); + wait(0.25); + all(); + wait(0.25); + sitei(); + wait(0.25); } } - + +void all() + +{ + + leds = 0xff; + wait(0.125); + leds = 0x00; + wait(0.125); + } + + void rotate() { volatile uint8_t i; @@ -21,4 +39,24 @@ leds = 1 << i; wait(0.125); } -} \ No newline at end of file + + for(i = 7; i > 0x00; i--) + { + leds = 1 << i; + wait(0.125); + + + } + leds = 0x01; + wait(0.125);\ +} + +void sitei() +{ + + + leds = 0x04; + wait(0.125); + } + + \ No newline at end of file