#include <reg51.h>
unsigned char temp[10] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}
unsigned char table[3];
unsigned int num;
void display(unsigned int num)
{
table[0] = temp[num / 100]
table[1] = temp[num / 10 % 10 ] | 0x80;
table[2] = temp[num % 10]
}
void main()
{
EA = 1;
TMOD |= 0x21;
TH0 = 0xfc;
TL0 = 0x18;
ET0 = 1;
TR0 = 1;
while(1)
{
display(num);
}
}
void timer0() interrupt 1//定时为2ms
{
static unsigned char i = 0;
static unsigned int j = 0;
TH0 = 0xfc;
TL0 = 0x18;
j++;
if(i < 3)
{
P2 = 0xf8;
P1 = 0x00;
P2