LCD + 16 keys keypad

I have a 16x2 LCD and a keypad with 16 keys...i can't find the example that when i push a button from keyboard and it's writing on LCD.I must mention that i have the LCD with shift register.

Start by searching for information on using matrix keypads.


Here is one:

#include <phi_interfaces.h>

#define btns_per_column 4
#define btns_per_row 4
char mapping[]={'1','2','3','A','4','5','6','B','7','8','9','C','*','0','#','D'};
byte pins[]={17, 16, 15, 13, 12, 11, 9, 8}; // Row pins then column pins
phi_matrix_keypads panel_keypad(mapping, pins, btns_per_row, btns_per_column);

void setup()

void loop()
  char temp;
  temp=panel_keypad.getKey(); // Use phi_keypads object to access the keypad
  if (temp!=NO_KEY) Serial.write(temp);

In the code I used Serial.print to display on arduino serial monitor but I think you can modify it to display on shift register driven LCD :wink:

Here’s library download: