One of the keys doesn't work correctly.
I have the declaration:
int adc_key_val[5] ={30, 150, 360, 535, 760 };
This means Key 1 -5 (Right, Up, Down, ...) See on this page.
The keys "Right" and "Down" etc. work correctly. When I press the Up-key (nr. 150) the value of Key Down is shown.
I learned that the values are derived from the resistors 1Key - 330R - 2Key - 620R - 3Key ....
Any ideas how to solve that problem, I resoldered the Keys, but couldnt get to the resistors. 8)
Do you mean you can't replace the resistors since you don't have those values?
Were the buttons working in the past? Are you using a different analogReference than default (5V)?
Problem solved! No soldering required.
I just had to pipe the values of the keys to the terminal and found out that one value was just over the threshold. When I changed that value it worked.
But:
-The polling frequency is to high - I slowed that down.
-The temperature drift is significant.
So I sometimes have to push the key several times to get the right reaction. I have to play with delay and debouncing.
LeseLaster:
So I sometimes have to push the key several times to get the right reaction. I have to play with delay and debouncing.
Good for you!
I use 20ms wait to debounce my buttons on digital pins. If you have to push the key several times, maybe you're not checking your key press as often as needed. I had that in the past.
With this design, you can't possibly press two buttons at the same time and get both buttons detected. When I only used 4 keys (to save two analog pins) I used to use up+down for escape. This one apparently can't do it. I wonder why they use this interesting way of hookup, as compared with just an R-2R ladder. Maybe to save space.
LeseLaster:
...
I just had to pipe the values of the keys to the terminal and found out that one value was just over the threshold. When I changed that value it worked.
...
Download the example code for check of the keypad signal values: LCD_KEYPAD_TEST0.ino