void time0() interrupt 1
{
TH0=(65536 - 10000) / 256;
TL0=(65536 - 10000) / 256;
WE = 1;
P0 = 0xfe;
WE = 0;
if(n==max)
{
while(block == 0)
{
DU = 1;
P0 = 0x06;
DU = 0;
beep = 0;
switch(index)
{
case 0:P1 = 0x03;break; //00000011 AB¸
case 1:P1 = 0x06;break; //00000110 BC
case 2:P1 = 0x0c;break; //00001100 CD
case 3:P1 = 0x09;break; //00001001 DA
}
index ++;
n=0;
}
while(block == 1)
{
DU = 1;
P0 = 0x3f; //0
DU = 0;
beep = 1;
switch(index)
{
case 0:P1 = 0x09;break;
case 1:P1 = 0x0c;break;
case 2:P1 = 0x06;break;
case 3:P1 = 0x03;break;
}
index ++;
// if (index == 4)
// index = 0;
n=0;