#include <REGX51.H>
void time50ms(unsigned char i)
unsigned char led[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
{
unsigned char k;
for(k=0;k<i;k++)
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
TR0=1;
while(!TF0);
TF0=0;
}
}
void main()
{
unsigned char i;
TMOD=0x01;
P1=0xff;
P2=0xff;
while(1)
{
for(i=0;i<60;i++)
{
P1=led[i/10];
P2=led[i%10];
time50ms(20);
}
}
}