wiz nxt
/
LED_blink_at_5second_wiznxt
blink led2 every 5 seconds.
Revision 0:4a11c98a6810, committed 2010-11-12
- Comitter:
- wiznxt
- Date:
- Fri Nov 12 00:39:04 2010 +0000
- Commit message:
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Nov 12 00:39:04 2010 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" + +Timeout timeout; +DigitalOut led1(LED1); +DigitalOut led2(LED2); +int on = 1; +void attimeout() { + on = 1; + led2 = !led2; +} +int main() { + while (1) { + if (on) { + timeout.attach(&attimeout, 5); + on = 0; + } + led1 = 1; + wait(0.5); + led1 = 0; + wait(0.5); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Nov 12 00:39:04 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e