Junichi Katsu
/
mbed_blinky__2
テスト用
Diff: main.cpp
- Revision:
- 1:f979189cb4ec
- Parent:
- 0:5e6fd9fcf7b2
diff -r 5e6fd9fcf7b2 -r f979189cb4ec main.cpp --- a/main.cpp Sat Dec 24 06:09:27 2016 +0000 +++ b/main.cpp Sat Dec 24 06:13:24 2016 +0000 @@ -1,12 +1,23 @@ #include "mbed.h" -DigitalOut myled(LED1); +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +DigitalOut myled4(LED4); + +DigitalOut myled[4] = {LED1,LED2,LED3,LED4}; int main() { while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + for(int i=0;i<4;i++) + { + myled[i] = 1; + wait(0.2); + } + for(int i=0;i<4;i++) + { + myled[i] = 0; + wait(0.2); + } } }