Try to start from programming a single button. 'Push the button' looks very simple but it involves jittering. To eliminate it, you should implement some kind of debouncer using a time delay, Schmitt-Trigger or another type of filter. To read the data from the pin you should configure IO direction to "input-state", which also involves input noise, so it also should be filtered in hardware. The solution of such filer can cause power consumption penalties. And, by the way, keypad can be even encoded. So, as I said, I recommend to study "push-the-button" matter from just one button first.
↧