Messa in campo 4 file - 26/06/2020 Francia

Dependencies:   mbed X_NUCLEO_IHM03A1_for

Fork of FORIGO_Modula_V7_3_VdcStep_maggio2020 by Francesco Pistone

main.cpp

Committer:
bcostm
Date:
2016-03-17
Revision:
0:5701b41769fd
Child:
2:35f13b7f3659

File content as of revision 0:5701b41769fd:

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

void print_char(char c = '*')
{
    printf("%c", c);
    fflush(stdout);
}

DigitalOut led1(LED1);

void print_thread(void const *argument)
{
    while (true) {
        Thread::wait(1000);
        print_char();
    }
}

int main()
{
    printf("\n\n*** RTOS basic example ***\n");
    Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
    while (true) {
        led1 = !led1;
        Thread::wait(500);
    }
}