#define uchar unsigned char
#define uint unsigned int
uchar code DSY_CODE[]=
{0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x7f,0x6f,0x00};
sbit Clear_Key = P3^2;
sbit Clear_Key1 = P3^3;
sbit p=P0^0;
uchar Count=0;
void deliy(uchar i)
{
uint t;
while (i--)
{
for(t=0;t<120;t++);
}
}
void Show_Count_ON_DSY()
{
P1 = DSY_CODE[Count];
if(Count==8)
Count=-1;
}
void Show_Count_ON_DSY1()
{
uchar r;
for(r=0;r<=9;r++)
{
P2 =DSY_CODE[r];
deliy(500);
}
}
void main()
{
P1 = 0xff;
P1 = DSY_CODE[0];
P2 = 0xff;
P2 = DSY_CODE[0];
p=1;
EA = 1;
EX0 = 1;
EX1 = 1;
IT0 = 1;
IT1 = 1;
IP = 0;
while(1)
{
}
}
void EX_INT0(void) interrupt 0 using 1
{
p=0;
deliy(150);
p=1;
Count++;
Show_Count_ON_DSY();
}
void EX_INT1(void) interrupt 2 using 2
{
Show_Count_ON_DSY1();
}