jeje

Dependencies:   mbed-rtos mbed

main.cpp

Committer:
JONEGU
Date:
2017-11-09
Revision:
0:61e934827cac

File content as of revision 0:61e934827cac:

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


DigitalOut Led1(PB_5);
DigitalOut Led2(PB_3);
DigitalOut Led3(PA_10);


void blink1( void constant*argument)
{
    while(1)
    {
        Led1= !Led1;
        Thread: wait(1000);
        }
}

void blink2( void constant*argument)
{
    while(1)
    {
        Led2= !Led2;
        Thread: wait(1200);
        }
}

void blink3( void constant*argument)
{
    while(1)
    {
        Led3= !Led3;
        Thread: wait(1500);
        }
}

int main()
{
    Thread thread1(blink1, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
    Thread thread2(blink2, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
    Thread thread3(blink3, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
    while (true) 
}