Void xianshi ()
{
TR0=0;
Num=0;
Sp=1;
delay(100);
Sp=0;
While (1)
{
for(a=0; a<4. +)
{
Delay (5);
The P2=table0 [a];
P0=table [display [a]];
}
The display [0]=num/10;
The display [1]=num % 10;
The display [2]=num1/10;
The display [3]=num1%10;
If (k4==0)
{
Num=num2;
Num1=0;
TR0=1;
L1=1;
L2=1;
return;
}
}
}
Void main ()
{
L1=1;
L2=1;
Sp=0;
X=0;
Num=num2=30;
While (1)
{
If (x==1)
{
Delay (5);
TR0=1;
While (1)
{
Keyboad ();
If (k4==0)
{
L1=1;
L2=1;
Delay (5);
Num=num2;
TR0=1;
}
}
}
The else
{
for(a=0; a<4. +)
{
Delay (5);
The P2=table0 [a];
P0=table [display [a]];
}
The display [0]=num/10;
The display [1]=num % 10;
The display [2]=num1/10;
The display [3]=num1%10;
The init ();
}
}
}
Void time0 () interrupt 1
{
TH0=(65536-10000)/256;
TL0=(65536-10000)%256;
count++;
If (k4==0)
{
Num=num2;
TR0=1;
Num1=0;
return;
}
for(a=0; a<4. +)
{
Delay (10);
The P2=table0 [a];
P0=table [display [a]];
}
The display [0]=num/10;
The display [1]=num % 10;
The display [2]=num1/10;
The display [3]=num1%10;
If (count==100)
{
Count=0;
Num -;
If (num<5)
{
L1=~ l1.
Sp=1;
Delay (200);
Sp=0;
If (num==0)
{
L1=0;
Sp=0; Delay (200); Sp=1;
delay(100);
Sp=0; Delay (200); Sp=1;
delay(100);
Sp=0; Delay (200); Sp=1;
}
If (num==0)
{
While (1)
{
Xianshi ();
If (k4==0)
{
L1=1;
L2=1;
Num=num2;
TR0=1;
return;
}
}
}
}
}
X2 + +;
If (x2==4)
{
X2=0;
}
P3=table2 (x2), }
CodePudding user response:
You look at the buzzer, a head of the network of the triangle symbol is ground or power supplyCodePudding user response:
//active or passive buzzer?//if it is a passive buzzer, the need to produce a pulse on the buzzer is about 2 k
CodePudding user response:
Program also didn't see you inside drive P14 the IO, the frequency of the driver should be around 3 k right, of course also can be 2 k, the characteristics of the buzzer frequency is generally 2 k or 4 k, so use about 3 k can juggle two buzzer,CodePudding user response:
More than 1 KHZ frequency input