![]() |
阿小哥 發(fā)表于 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(); } |
使用外部中斷觸發(fā)后掃描按鍵嗎? |