mbed-rtos support for nucleo f401re

Dependencies:   mbed-rtos_F401 mbed-src

Fork of rtos_basic by mbed official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "rtos.h"
00003  
00004 Serial pc(SERIAL_TX, SERIAL_RX);
00005 DigitalOut led2(LED2);
00006  
00007 void led2_thread(void const *args) {
00008     while (true) {
00009         led2 = !led2;
00010         Thread::wait(1000);
00011     }
00012 }
00013  
00014 int main() {
00015     Thread thread(led2_thread);
00016     int i = 1;
00017    
00018     while(1) { 
00019       wait(1);
00020        pc.printf("main thread running !\n");
00021        Thread::wait(1000);
00022   }
00023 }