赞
踩
uchar_8 Key_Scan() { uchar_8 Temp_C,Temp_R; Key_Value =0xF0; P44 =P42 =1; if(((Key_Value & 0xF0) !=0xF0) || ((P44 & P42) !=1)) { Delay(10); //10ms if(((Key_Value & 0xF0) !=0xF0) || ((P44 & P42) !=1)) { if(!P44) { Temp_C = Key_Value & 0x70; } else if(!P42) { Temp_C =Key_Value & 0xB0; } else Temp_C =Key_Value & 0xF0; Key_Value =0x0F; P44 =P42 =0; Temp_R =Key_Value & 0x0F; while((Key_Value &0x0F) !=0x0F); return (Temp_C | Temp_R); } } return 0xFF; } uchar_8 Mtx_Key() { switch(Key_Scan())//调用键盘反转扫描函数 { case 0x7E: return 0; break; //1 case 0xBE: return 1; break; case 0xDE: return 2; break; case 0xEE: return 3; break; case 0x7D: return 4; break; //2 case 0xBD: return 5; break; case 0xDD: return 6; break; case 0xED: return 7; break; case 0x7B: return 8; break; //3 case 0xBB: return 9; break; case 0xDB: return 10; break; case 0xEB: return 11; break; case 0x77: return 12; break; //4 case 0xB7: return 13; break; case 0xD7: return 14; break; case 0xE7: return 15; break; default: break; } return 0xFF; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。