I am working on ST72324 chip and have to program it for a 4X5 keyboard that is attached to PORT B and PORT C pins. The problem is I have to detect the key press as well as the key release. The key press detection is not a problem but how can I capture a key release? I am polling the keyboard every 2 millisecs using the timer interrupt. Regards Chetan
you should use flag flKeyPress, which is set when any key is pressed.
Then: if ((flKeyPress) and (ScanKeyBoard() == noKEY)) //key released and do it each 2 ms... Do not forget that you should filter glitches on the switches... ;)