masamitsu shibata
/
test5
homework
main.cpp@0:5193eafa81b6, 2014-04-11 (annotated)
- Committer:
- Kojiro
- Date:
- Fri Apr 11 10:50:46 2014 +0000
- Revision:
- 0:5193eafa81b6
- Child:
- 1:3917701817b4
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojiro | 0:5193eafa81b6 | 1 | #include "mbed.h" |
Kojiro | 0:5193eafa81b6 | 2 | |
Kojiro | 0:5193eafa81b6 | 3 | BusOut leds(P1_13, P1_14, P1_22, P0_17, P0_18, P0_19, P1_15, P0_1); |
Kojiro | 0:5193eafa81b6 | 4 | |
Kojiro | 0:5193eafa81b6 | 5 | void rotate(); |
Kojiro | 0:5193eafa81b6 | 6 | |
Kojiro | 0:5193eafa81b6 | 7 | int main() |
Kojiro | 0:5193eafa81b6 | 8 | { |
Kojiro | 0:5193eafa81b6 | 9 | |
Kojiro | 0:5193eafa81b6 | 10 | while(1) |
Kojiro | 0:5193eafa81b6 | 11 | { |
Kojiro | 0:5193eafa81b6 | 12 | rotate(); |
Kojiro | 0:5193eafa81b6 | 13 | } |
Kojiro | 0:5193eafa81b6 | 14 | } |
Kojiro | 0:5193eafa81b6 | 15 | |
Kojiro | 0:5193eafa81b6 | 16 | void rotate() |
Kojiro | 0:5193eafa81b6 | 17 | { |
Kojiro | 0:5193eafa81b6 | 18 | volatile uint8_t i; |
Kojiro | 0:5193eafa81b6 | 19 | for(i = 0x00; i < 8; i++) |
Kojiro | 0:5193eafa81b6 | 20 | { |
Kojiro | 0:5193eafa81b6 | 21 | leds = 1 << i; |
Kojiro | 0:5193eafa81b6 | 22 | wait(0.125); |
Kojiro | 0:5193eafa81b6 | 23 | } |
Kojiro | 0:5193eafa81b6 | 24 | } |