程序如下,请问数码管为什么一直显示0而没有其他变化?
#include
#define uint unsigned int
#define uchar unsigned char
sbit dula=P2^0;
sbit wela=P2^1;
uchar tt,num;
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,
0xc6,0xa1,0x84,0x8e};
void main()
{
tt=0;
num=0;
TMOD=0X01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
wela=1;
P1=0x55;
wela=0;
dula=1;
P1=0xc0;
dula=0;
while(1)
{
if(tt==20)
{
tt=0;
num=num++;
dula=1;
P1=table[num];
dula=0;
}
}
}
void time0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt++;
}