#include<reg52.h>
unsigned char shumaguan[16]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
unsigned char time_num;
unsigned int time;
void delay(unsigned int i)
{
while(i--);
}
void main()
{
time_num=0;
time=0;
TMOD=1;
TH0=0xec;
TL0=0x77;
ET0=1;
EA=1;
TR0=1;
while(1)
{
P0=shumaguan[time];
}
}
void timer0()interrupt 1
{
TH0=0xec;
TL0=0x77;
time_num++;
if(time_num==50)
{
time_num=0;
time++;
if(time==16)
{
time=0;
}
}
} //有警告
|