鍵盤按下判斷函數(shù):
unsigned char Key_Press()
{
unsigned char KeyRead=00;
DDRD=0xf0;
PORTD=0x0f;
KeyRead=PIND;
KeyRead&=0x0f;
if(KeyRead!=0x0f)
....
}
問題:直接讀取PIND的值就可以判斷是否有按鍵按下了,為什么還要把讀取的值和0x0f作與運(yùn)算呢
| 歡迎光臨 (http://m.raoushi.com/bbs/) | Powered by Discuz! X3.1 |