键盘按下判断函数:
unsigned char Key_Press()
{
unsigned char KeyRead=00;
DDRD=0xf0;
PORTD=0x0f;
KeyRead=PIND;
KeyRead&=0x0f;
if(KeyRead!=0x0f)
....
}
问题:直接读取PIND的值就可以判断是否有按键按下了,为什么还要把读取的值和0x0f作与运算呢
欢迎光临 (http://www.51hei.com/bbs/) | Powered by Discuz! X3.1 |