Joscha Ihl
/
Nucleo_rtos_basic3
test
Diff: main.cpp
- Revision:
- 0:dc0a61d94e89
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Oct 17 08:21:46 2017 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "rtos.h" +#include <iostream> + +using namespace std; + +DigitalOut led1(LED1); + +void print_thread(void const *argument) +{ + while (true) { + Thread::wait(1000); + cout << "print_thread!\r" << endl; + } +} + +int main() +{ + cout << "BASIC EXAMPLE\r\n"; + Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE); + while (true) { + led1 = !led1; + Thread::wait(500); + cout << "LED Thread\r" << endl; + } +}