Blinky disco lights for the K64F implemented with RTOS threads.
Fork of K64F-RTOS-Disco-LEDs by
Revision 0:f1e76cd00a6e, committed 2014-08-07
- Comitter:
- bundgus
- Date:
- Thu Aug 07 03:03:03 2014 +0000
- Commit message:
- Initial Commit
Changed in this revision
diff -r 000000000000 -r f1e76cd00a6e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Aug 07 03:03:03 2014 +0000 @@ -0,0 +1,37 @@ +#include "mbed.h" +#include "rtos.h" + +void blinkLED1(void const *args) { + DigitalOut led1(LED1); + while(true){ + led1 = !led1; + Thread::wait(300); + } +} + +void blinkLED2(void const *args) { + DigitalOut led2(LED2); + while(true){ + led2 = !led2; + Thread::wait(500); + } +} + +void blinkLED3(void const *args) { + DigitalOut led3(LED3); + while(true){ + led3 = !led3; + Thread::wait(800); + } +} +int main() { + + Thread thread1(blinkLED1); + Thread thread2(blinkLED2); + Thread thread3(blinkLED3); + + while (true) { + Thread::wait(250); + } + +}
diff -r 000000000000 -r f1e76cd00a6e mbed-rtos.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Thu Aug 07 03:03:03 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#34e80e862021
diff -r 000000000000 -r f1e76cd00a6e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Aug 07 03:03:03 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6213f644d804 \ No newline at end of file