} { ENA = 1; } else if(speed < 100) { } else speed = 0; ENA = 0;
void time1() interrupt 3
{
TH1 = 0x0F8;
TL1 = 0x30;
i =(i+1) % 4;
}
//定时2ms //0-3循环 //显示最低位数码管 //段选清零防止乱码 //送段码信号 j++; if(i == 0) { P0 = 0x00; P0 = table[time%10]; } if(i == 1) { P0 = 0x00; } P0 = table[time/ 10% 10]; if(i == 2) { P0 = 0x00; } P0 = table[time/ 100% 10]; if(i == 3) { P0 = 0x00; P0 = table[time/ 1000% 10]; //送位选信号 } P2 = ( 0x10 << i ); if(j == 500) { } time ++; j = 0; //500次为1秒