Lab 5 - mbed RTOS

Dependencies:   mbed-rtos mbed

Fork of FTF2014_lab5 by Freescale

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 DigitalOut led1(LED1);
00005 
00006 void led2_thread(void const *argument)
00007 {
00008     while (true) {
00009         Thread::wait(2000);
00010         printf("Thread 2 \n");
00011         fflush(stdout);
00012     }
00013 }
00014 
00015 int main()
00016 {
00017     Thread thread(led2_thread);
00018 
00019     while (true) {
00020         led1 = !led1;
00021         Thread::wait(1000);
00022         printf("Thread 1 \n");
00023         fflush(stdout);
00024     }
00025 }