void Timer0_Service() interrupt 1
{
static uint count = 0;
static uchar flag = 0;
static uchar flag2 = 0;
unsigned int i,j;
//count = 0;
TR0 = 0;
TH0 = 0xec;
TL0 = 0x78;
TR0 = 1 ;
count++;
LED1=1;
LED2=0;
//bell=1;
if( count ==30000)
{
bell =0;
count = 0;
count++;
LED1=0;
LED2=0;
/* TH0 = 0xec;
TL0 = 0x78; */
flag++;
/*for(i=0;i<11000;i++)
{for(j=0;j<1100;j++);}
i=0;j=0;*/
}
if( flag ==5)
{
bell=1;
// flag = 0;
//TR0 = 0;
/*TH0 = 0xec;
TL0 = 0x78; */
LED2=0;
LED1=1;
//count=0;
/* for(i=0;i<11000;i++)
{for(j=0;j<11000;j++);}
i=0;j=0;*/
}
if( flag ==5)
{
flag = 0;
//TR0 = 0;
LED2=0;
LED1=0;
TH0 = 0xec;
TL0 = 0x78;
count=0;
/* for(i=0;i<11000;i++)
{for(j=0;j<11000;j++);}
i=0;j=0;*/
}
}
|