#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
sbit beep=P1^5;
uint a;
void delay()
{uint x,y;
for(x=10;x<0;x--)
for(y=10;y<0;y--);
}
void chuankou()
{ TMOD=0x20;
TH1=0xF3;
TL1=0xF3;
TR1=1;
SCON=0x50;
PCON=0x80;
ES=1;
EA=1;
}
void main()
{ chuankou();
while(1)
{ if(a==1)
{ beep=~beep;
delay();
}
}
}
void deepint() interrupt 4
{
a=SBUF;
RI=0;
SBUF=a;
while(!TI);
TI=0;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/261168.html
標籤:單片機/工控
上一篇:PADS間距報錯問題
下一篇:PADS間距錯誤
