標(biāo)題: 大佬幫幫忙,翻譯一下單片機(jī)聲控?zé)舻某绦颉?[打印本頁]
作者: KrisTan 時(shí)間: 2020-2-29 17:34
標(biāo)題: 大佬幫幫忙,翻譯一下單片機(jī)聲控?zé)舻某绦颉?br />#include<reg52.h>
#define uint unsigned int
sbit JD=P1^7;
sbit GM=P1^6;
void delay(uint z);
main()
{
TMOD=0x10;
EA=1; ET1=1;
JD=0;
GM=0;
while(1)
{
if(JD= =1)
{
delay(3000);
JD=0;
}
}
}
void counter1( ) interrupt 3
{
if(GM==1)
{JD=1;}}
void delay(uint z)
{
uint x,y;
for(x=110;x>0;x--)
for(y=z;y>0;y--);
}
歡迎光臨 (http://www.torrancerestoration.com/bbs/) |
Powered by Discuz! X3.1 |