Junichi Katsu
/
mbed_blinky__2
テスト用
Revision 1:f979189cb4ec, committed 2016-12-24
- Comitter:
- jksoft
- Date:
- Sat Dec 24 06:13:24 2016 +0000
- Parent:
- 0:5e6fd9fcf7b2
- Commit message:
- LED4???????????
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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); + } } }