unsigned char GetKey(void)
{
unsigned char KeyTemp,CheckValue,Key = 0x00;
CheckValue = P3&0x4c;
if(CheckValue==0x4c)
return 0x00;
Delay1ms(10);
KeyTemp = P3&0x4c;
if(KeyTemp==CheckValue)
return 0x00;
if(!(CheckValue&0x04))
Key|=0x01;
if(!(CheckValue&0x08))
Key|=0x02;
if(!(CheckValue&0x40))
Key|=0x04;
return Key;
}
|