RTOS example - blinking two LEDs on a NUCLEO-F446RE board
main.cpp
- Committer:
- cspista
- Date:
- 2022-02-24
- Revision:
- 0:a57cf939cc01
File content as of revision 0:a57cf939cc01:
#include "mbed.h"
#include "rtos.h"
DigitalOut led1(D13);
DigitalOut led2(D12);
Thread thread;
void led2_thread() {
while (true) {
led2 = !led2;
Thread::wait(1000);
}
}
int main() {
thread.start(led2_thread);
while (true) {
led1 = !led1;
Thread::wait(500);
}
}