#include "iom16v.h"
#include "macros.h"
#define uchar unsigned char
#define uint unsigned int
uint Number[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x00,};
void delay(uint ms)
{
uint i,j;
for(i=0;i
for(j=0;j<1141;j++);
}
void jishi(uint x,uint y)
{
PORTB=Number[x];//ÏÔʾÊý×Ö0~9£¬ÖеÄÒ»¸öÊý
PORTA|=BIT(3);
PORTA&=~BIT(3);
PORTB=0XFF;
PORTB&=~BIT(y);//ѡλ
PORTA|=BIT(4);
PORTA&=~BIT(4);
delay(1);
}
void main()
{
DDRB=0XFF;
DDRA|=BIT(3);
DDRA|=BIT(4);
while(1)
{
uint m,n=0,a,b,c,d,e,k;
loop: m=0;n=0;a=0;b=0;c=0;d=0;e=0;
for(m=0;m<3;m++)
{
for (a=0;a<10;a++)
{
n=n+1;
if(m==2 && n==25)
{
goto loop;
}
for(b=0;b<6;b++)
{
for(c=0;c<10;c++)
{
for(d=0;d<6;d++)
{
for(e=0;e<2000;e++)
{
k=(int)(e/200);
jishi(k,5);
jishi(d,4);
jishi(c,3);
jishi(b,2);
jishi(a,1);
jishi(m,0);
}
}
}
}
}
}
}
}