#include <reg52.h>
sbit BEEP = P1^6;
sbit LED2 = P0^0;
sbit ADDR2 = P1^2;
sbit ADDR1 = P1^1;
sbit ADDR0 = P1^0;
sbit ENLED = P1^4;
sbit ADDR3 = P1^3;
void
delay_ms(unsigned
int
x)
{
unsigned
int
i,j;
if
(x==1000)
{
for
(i=0;i<19601;i++)
{
for
(j=5;j>0;j--);
}
}
else
while
(x--)
for
(j=115;j>0;j--);
}
void
main()
{
unsigned
int
i,
time
;
ADDR3 = 1;
ENLED = 0;
ADDR2 = 1;
ADDR1 = 1;
ADDR0 = 0;
while
(1)
{
LED2=0;
for
(
time
=0;
time
<3700;
time
++)
{
BEEP=!BEEP;
for
(i=0;i<30;i++);
}
BEEP=0;
LED2=1;
delay_ms(1000);
}
}