Gleb Klochkov / Mbed OS Climatcontroll_Main

Dependencies:   esp8266-driver

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 void print_char(char c = '*')
00004 {
00005     printf("%c", c);
00006     fflush(stdout);
00007 }
00008 
00009 Thread thread;
00010 
00011 DigitalOut led1(LED1);
00012 
00013 void print_thread()
00014 {
00015     while (true) {
00016         wait(1);
00017         print_char();
00018     }
00019 }
00020 
00021 int main()
00022 {
00023     printf("\n\n*** RTOS basic example ***\n");
00024 
00025     thread.start(print_thread);
00026 
00027     while (true) {
00028         led1 = !led1;
00029         wait(0.5);
00030     }
00031 }