ksdir 发表于 2014-10-12 17:29:05

[求助]使用定时器方式2中断键盘扫描程序,无法正确读取...

void timer1(void) interrupt 3 using 1
{       
    count++;      
        if(count>=35)       
        {
          count=0;
                 Key_4x4=Key_Read();
        }
}
/*****************主函数***************/
void main()
{
/*****************中断系统初始化***************/
count=0;
TMOD=0X20;//设T1工作方式控制字,工作于方式2
TH1=0X00;          //定时器初始值设置,
TL1=0X00;       
EA=1;                  
ET1=1;          
TR1=1;          
/*****************液晶模块初始化***************/
        init();//LCD初始化
    clear_screen(0); //清屏

    while(1)
    {
      display();
    }
这样无法正确读取键值,这是怎么回事呢?
页: [1]
查看完整版本: [求助]使用定时器方式2中断键盘扫描程序,无法正确读取...