#include
#define uchar unsigned char
sbit dula=P2^0;
sbit wela=P2^1;
uchar num,num1;
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,
0xc6,0xa1,0x84,0x8e};
void main()
{
num1=0;
wela=1;
P1=0xed;
wela=0;
dula=1;
P1=0xc0;
dula=0;
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
while(1)
{
if(num==10)
{
num=0;
++num1;
dula=1;
P1=table[num1];
dula=0;
if(num1==15)
num1=-1;
}
}
}
void time0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
num++;
}