Akira Kashihara
/
Sample3
This program uses "for(){}".
Revision 0:d9f481521c3e, committed 2012-10-11
- Comitter:
- AkiraK
- Date:
- Thu Oct 11 15:44:57 2012 +0000
- Commit message:
- Sample3;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r d9f481521c3e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 11 15:44:57 2012 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" + +DigitalOut myleds[] = {p5, p6, p7, p8, p9, p10}; + +int main() +{ + while(true) { + for(int i = 0; i < 6; i++) { + myleds[i] = 1; + wait(0.2); + } + for(int i = 5; i > -1; i--) { + myleds[i] = 0; + wait(0.2); + } + } +} \ No newline at end of file
diff -r 000000000000 -r d9f481521c3e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 11 15:44:57 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc \ No newline at end of file