如何编写STM32控制LED反转C程序

2025-03-22 13:14:00
推荐回答(1个)
回答1:

int onoff = 1; //点亮
int count = 5000;

while(true)
{
LED = onoff; //先点亮
count = 5000;

while(count) ; //空跑CPU,为了占用时间,留出反转时间
onoff = !onoff; //LED反转

}