Lab 5 - mbed RTOS

Dependencies:   mbed-rtos mbed

Fork of FTF2014_lab5 by Freescale

main.cpp

Committer:
Kojto
Date:
2014-04-07
Revision:
2:807a744a53e4
Parent:
0:5de53f2725a4

File content as of revision 2:807a744a53e4:

#include "mbed.h"
#include "rtos.h"

DigitalOut led1(LED1);

void led2_thread(void const *argument)
{
    while (true) {
        Thread::wait(2000);
        printf("Thread 2 \n");
        fflush(stdout);
    }
}

int main()
{
    Thread thread(led2_thread);

    while (true) {
        led1 = !led1;
        Thread::wait(1000);
        printf("Thread 1 \n");
        fflush(stdout);
    }
}