如何使用 mbed + PlatformIO 切换 STM32F429I-DISCOVERY LED
此简单固件切换 STM32F429I-DISC1 发现板上的 LED。
stm32f429_toggle_led.cpp
#include <mbed.h>
DigitalOut myled(LED1);
int main() {
while(1) {
myled = !myled;
wait(0.5);
}
}这将每秒切换两次绿色 (PG13) LED。
程序很简单:我们使用 myled = !myled; 切换 LED,然后使用 wait(0.5) 等待 0.5 秒。
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow