example use library LibThreadProcess
Dependencies: LibThreadProcess mbed-rtos mbed
Fork of rtos_signals by
Diff: main.cpp
- Revision:
- 4:fde9ea156f7c
- Parent:
- 1:6a8fcc666593
--- a/main.cpp Tue Jun 04 15:54:12 2013 +0100 +++ b/main.cpp Tue May 24 06:47:15 2016 +0000 @@ -1,21 +1,12 @@ #include "mbed.h" -#include "rtos.h" - -DigitalOut led(LED1); +#include "BlinkLed.h" -void led_thread(void const *argument) { - while (true) { - // Signal flags that are reported as event are automatically cleared. - Thread::signal_wait(0x1); - led = !led; - } -} +BlinkLed led1(LED1, 500); +BlinkLed led2(LED2, 1000); +BlinkLed led3(LED3, 2000); -int main (void) { - Thread thread(led_thread); - - while (true) { - Thread::wait(1000); - thread.signal_set(0x1); - } -} +int main() { + led1.startBlink(); + led2.startBlink(); + led3.startBlink(); +} \ No newline at end of file