case 0x19: //ABC
cnt++;
if(TF1==1)
{
TF1 = 0;
TL1 = 0x00; //设置定时初值
TH1 = 0x4C; //设置定时初值
tcount++;
if(tcount == 20)
{
keycount();
// delay_ms(30);
cnt = 0;
}
}
void keycount(void)
{
switch(cnt)
{
case 1:
led1 = 1;
break;
case 2:
led2 = 1;
break;
case 3:
led3 = 1;
break;
}
}
这样写实现不了 |