cancel
Showing results for 
Search instead for 
Did you mean: 

Keyboard interface

digichetan
Associate II
Posted on December 15, 2005 at 00:47

Keyboard interface

3 REPLIES 3
digichetan
Associate II
Posted on November 29, 2005 at 15:42

Hi

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

Viktor POHORELY
ST Employee
Posted on November 30, 2005 at 08:53

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... 😉

digichetan
Associate II
Posted on December 15, 2005 at 00:47

Thank you...

Figured it out and also implemented considering the glitches..