Keypad

From Reef Projects

Jump to: navigation, search

I got a cheap 16 key membrane keypad from ebay that plugs into the LCD controller from web4robot. Using the v0.4 Library I got the sample keypad sketch running but ran into a bug. When a key was pressed, garbage would show up on the screen:


Image:LCD garbage.jpg

Here is a video


To fix this, there needs to be a delay after each lcd.print() command of about 10ms.

ex:


void loop()
{
  
int keyInput;

  keyInput=lcd.keypad();
  
  lcd.setCursor(1,10);
  
  lcd.print("   ");      // Clear prev entry
  
  delay(10);  //this is a needed delay
  
  lcd.setCursor(1,10);
  
  lcd.print(keyInput,DEC);// Print the value we got back from the keypad
                    
  delay(10);  //this is a needed delay
  
  
}


Keypad:

image:Key_pad.jpg

Schematic:

image:Keypad_circuit.jpg

Personal tools