I cant detect anything with the following code (8051 and the keypad i connected to the port 0)
#define K0_mask 0xED #define K1_mask 0x7E #define K2_mask 0x7D #define K3_mask 0x7B #define K4_mask 0xBE #define K5_mask 0xBD #define K6_mask 0xBB #define K7_mask 0xDE #define K8_mask 0xDD #define K9_mask 0xDB .... unsigned char readKeyboard() { //Enter if a key has been pressed if (portState!=0xFF) { //need a 21ms debounce period timerWait25(); //check the key pressed if (portState == K0_mask) { //Display the digit writeToLCD(0,6); //wait for the touch to be released while (portState ==K0_mask); return(0); } ...
DOESNT WORK....why ??? thanks for any help