Blink LED example.
Dependencies: mbed-STM32F103C8T6
main.cpp
- Committer:
- hankzhang
- Date:
- 2020-04-15
- Revision:
- 4:1855f15244e7
- Parent:
- 3:bfe628be05ee
File content as of revision 4:1855f15244e7:
#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); } }