Blink LED example.

Dependencies:   mbed-STM32F103C8T6

main.cpp

Committer:
hankzhang
Date:
2020-04-15
Revision:
3:bfe628be05ee
Parent:
1:6554c60faa06

File content as of revision 3:bfe628be05ee:

#include "mbed.h"
#include "stm32f103c8t6.h"

DigitalOut led1(PC_13);

Thread thread;
#if 1
Thread thread1;
Thread thread2;
 
void led2_thread() {
    while (true) {
        led1 = !led1;
        wait(3);
    }
}

void led1_thread() {
    while (true) {
        //led1 = !led1;
        wait(4);
    }
} 
#endif

void led0_thread() {
    while (true) {
        led1 = !led1;
        wait(2);
    }
}
int main() {
    thread.start(led0_thread);
    thread1.start(led1_thread);
    thread2.start(led2_thread);
    
    while (true) {
        //led1 = !led1;
        wait(0.5);
    }
}