c语言控制led灯交替闪烁 , 求单片机c51的C语言编程:设当开关为1时,控制2个led交替闪烁,闪烁时间为5秒
bit LED1;bit LED2;LED1=1;LED2=0;while (1){ delay(2000);LED1=!LED1;LED2=!LED2;} include#defineucharunsignedcharuchartimes,led;sbitkey1=P1^0;sbitkey2=P1^1;voidt0isr()interrupt1{TH0=(65536-50000)/256
改造DIY
2024-04-16
14 阅读