阿小哥 发表于 2020-2-20 19:26 如何与标准键盘键码的映射表对应 |
嗯,是的。这是我通过的程序,反转是分先后的,按键的两边是不一样的。 void Read_Key() interrupt 0 { unsigned char Key_1,Key_2,Key; unsigned char i; Buzz_Start(); P1=0x0F; if(P1!=0x0F) { Delay(); if(P1!=0x0F) { Key_1=P1&0x0F; } } P1=0xF0; if(P1!=0xF0) { Delay(); if(P1!=0xF0) { Key_2=P1&0xF0; } } Key=Key_1|Key_2; for(i=0;i<10;i++) { if(Key==Key_Code[i]) { WDat(Num_TAB[i]); } } while((P1&0xF0)!=0xF0); Buzz_Stop(); } |
使用外部中断触发后扫描按键吗? |