jollen chen
/
mbed_led_run
advanced "hello, world"
Revision 0:c32ee89676db, committed 2015-01-20
- Comitter:
- jollen
- Date:
- Tue Jan 20 06:50:10 2015 +0000
- Commit message:
- advanced "Hello, World"
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 c32ee89676db main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jan 20 06:50:10 2015 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" + +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +DigitalOut myled4(LED4); + +unsigned int mask = 0x1; + +int main() { + wait(0.8); + + while(1) { + myled1 = mask & 0x1; + myled2 = mask & 0x2; + myled3 = mask & 0x4; + myled4 = mask & 0x8; + + wait(0.2); + + mask = mask << 1; + + if (mask & 0x10) + mask = 0x1; + } +}
diff -r 000000000000 -r c32ee89676db mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jan 20 06:50:10 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file