#include #include void delay(unsigned int i)
#define uchar unsigned char
uchar table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
{
unsigned int a;
uchar b;
for (a = 1; a < i; a++)
{
for (b = 0; b<250; b++);
}
}
void main()
{uchar i,j,k;
DDRB=0xff;
DDRC=0xff;
while(1)
{
for(i=0;i<100;i++)
{
if(i<10)
{PORTC =0xfe;
PORTB=dis(i);
delay(1000);
PORTC =0xff;}
else {
for(k=0;k<200;k++)
{
j=i/10;
PORTC =0xfd;
PORTB=dis(j);
delay(3);
PORTC=0xff;
j=i%10;
PORTC =0xfe;
PORTB=dis(j);
delay(3);
PORTC=0xff;
}
};
}
}
}
uchar dis(uchar n)
{uchar m;
m= table[n];
return m;
}