Simple test program to get familiar with functionality of MBED RTOS on ST Nucleo-F411RE. Tasks for LED blinking, user button, temperature measurement with DS1620, temperature measurement with internal temperature sensor of ST32F411RE, ultrasonic distance measurement and displaying result on 16x2 TextLCD.
Dependencies: DS1620_improved TextLCD_improved mbed-rtos mbed
Diff: tsk_led.cpp
- Revision:
- 9:645f0e517017
- Child:
- 11:e89f89c0920b
diff -r 812c2b49251f -r 645f0e517017 tsk_led.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsk_led.cpp Mon Dec 14 11:32:15 2015 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "rtos.h" + +#include "tsk_led.h" + + +struct led_flash_times_struct led_flash_times = { 100, 2500 }; + + +static DigitalOut led2(LED2); + + +void led2_thread(void const *args) { + + while (true) { + led2 = 1; + Thread::wait(led_flash_times.on_time); + + led2 = 0; + Thread::wait(led_flash_times.off_time); + } +}