数码管跳动的时间没有1S怎么回事??
#include<reg52.h>unsigned char LEDchar[]=
{0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
void main()
{
unsigned char cnt = 0;
unsigned char i = 0;
TMOD = 0x01;
TH0 = 0xb1df; // x*12/12000000=0.02s x=20000 x+y=65535 y=45535=0xb1df
TL0 = 0x00;
TR0 = 1;
while (1)
{
if(TF0==1)
{
TF0 = 0;
TH0 = 0xb1df;
TL0 = 0x00;
cnt++;
if(cnt>=50)
{
cnt = 0;
P0 = LEDchar[i];
i++;
if(i>=9)
{
i = 0;
}
}
}
}
}