Page 1 of 1

lcd keypad shiled problem

PostPosted: Thu Mar 12, 2015 6:23 pm
by skyrock
hello,

I have just purchased and tested the lcd kepad shield. Using the sample code from your site with ct-uno + lcd keypad shield without any other modification. However, the keypad reads incorrectly. Is the shield malfunction?

regards,
Sky

Re: lcd keypad shiled problem

PostPosted: Thu Mar 12, 2015 11:34 pm
by ober
What is the incorrect value? Can you show it?

Re: lcd keypad shiled problem

PostPosted: Fri Mar 13, 2015 10:22 am
by skyrock
when i press the right key, it shows right. But when i pressed the up key, it shows left. and down key becomes select. both left and select key was not detected.

I have not modified the source code.

regards.

*edit*
i have used another code and found that the value for right is 0, up is 512, down is 683, left is 768, select is 819

Re: lcd keypad shiled problem

PostPosted: Sun Mar 15, 2015 10:25 pm
by ober
The LCD keypad shield is using resistor ladder to detect key press. The resistor value might not be same as other LCD keypad shield. So reading the ADC value and replace it in the example sketch would fix the problem.

Example, the original sketch:
int adc_key_val[5] ={30, 150, 360, 535, 760 };

replace it with what you see at ADC value:
int adc_key_val[5] ={0, 512, 683, 768, 819 };

Try it.