I couldn't Press Two Buttons on Matrix Keypad with Arduino

2.6k views Asked by At

My english is not perfect, so I am sorry. I hope you understand my problem. I am working on an arduino project. I connected a 4x3 Matrix Keypad to Arduino. Now, when I press '1' on keypad, A is showing on LCD Display and when I press '2', B is showing on LCD. But I want when I press two buttons on keypad (both of 1 and 2) C is shown on the screen. But I couldn't. I trying to receive data from two buttons at the same time but I couldn't. Please help me

1

There are 1 answers

3
UncleO On

Be sure to use the Keypad library.

This library has a function called getKeys() which populates a list with all the pressed keys.

Then you can call isPressed(keyChar) on each of the keys you want to make sure both are pressed.

Be careful not to arrange a sequence of if/else statements so that a single key press satisfies an earlier if condition so that a double key press in some later condition is never checked.