![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
mbed RTOS Basic
Diff: main.cpp
- Revision:
- 0:be1314d845cf
diff -r 000000000000 -r be1314d845cf main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 20 12:19:56 2016 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "rtos.h" + +DigitalOut led1(LED1); +DigitalOut led2(LED2); + +void led2_thread(void const *args) { + while (true) { + led2 = !led2; + Thread::wait(1000); + } +} + +int main() { + Thread thread(led2_thread); + + while (true) { + led1 = !led1; + Thread::wait(500); + } +}