单颗 LED 指示灯的闪烁控制 void main(){ while(1){if(f1s==1){f1s=0;LedBlink(10,2);// 每个周期内闪烁两次 }} } //time1:time1*10ms= 闪烁周期(定时时间基准 10ms) //time2:闪烁周期内的闪烁次数 void LedBlink(u8 time1 ,u8 time2){static u8 tempnum = 0;if(++tempnum > time1){tempnum = 0;}if( tempnum {LED0=!LED0;}else{LED0=1;}} //中断服务函数, 10ms 中断 void TIM3_IRQHandler(void) {if(TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) {TIM_ClearITPendingB