標題: 單片機使led閃爍亮2秒,滅2秒,如此循環(huán) [打印本頁]

作者: rongxinjunrong    時間: 2024-1-15 22:21
標題: 單片機使led閃爍亮2秒,滅2秒,如此循環(huán)
#include <REG52.H>
void delay(int t)
{
while(--t);}
void delaym(int t)
{
while(t--){
  delay(100);
}
}
void main()
{
while(1)
{
P2=0x00;
delaym(100);
P2=0xff;
  delaym(100);
}
}

stc89c52rcrong.pdf

31.62 KB, 下載次數(shù): 0






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1