LCD Keypad Shield – Entering and Storing Numbers

WagnerJ:
The values I get on your code is as follows:

Select = 605
Up = 113
Down = 253
Left = 387
Right = 19

That's a bit different from the values on my LCD Keypad Shield.

With those values I'd change the button detection code in the example code from reply #8 to:

  if (adc_key_in <50) returnValue= btnRIGHT;
  else if (adc_key_in <195) returnValue= btnUP;
  else if (adc_key_in <330) returnValue= btnDOWN;
  else if (adc_key_in <450) returnValue= btnLEFT;
  else if (adc_key_in <999) returnValue= btnSELECT;

WagnerJ:
To tell you a bit more about my project, I'm a farmer in South Africa and I find it quite difficult to keep track of all the vehicles's fuel filling data. So what I'm building is a fuel filling logger where the driver swipes his RFID tag, then the vehicles RFID tag and after that fill in the vehicles ODO Hours/Kms on the keypad. After that the pump goes active via a relay and a flowmeter measures the amount of diesel. Once the pump nozzle is put back into the cradle all the individual data is saved on the SD into a .csv file from where it can be loaded to a web server from where I can grab it to my computer for processing. Jeez that is a mouth full! :slight_smile:

So at the moment I don't see any need in your application for manually entering numbers by using buttons.
But maybe you want to have some "special functions" which will become active after entering "magic numbers".

Just let me know if you have problems with entering data into the application.

After changing the 'split values' for button detection to fit your Keypad Shield, the code from reply #8 should also work with your Keypad Shield buttons.