Skip to content
Go to file


Failed to load latest commit information.
Latest commit message
Commit time

LCDKeypad Arduino library

This library allows you to control display, read button state and toggle backlight of LCDKeypad shield.

LCDKeypad shield is quite common and popular. It includes 16x2 HD44780 compatible LCD and 5 push buttons. Pins 4, 5, 6, 7, 8, 9 are used to interface with the LCD. Backlight on/off function is controlled via pin 10. Analog pin 0 is used to read the buttons.

alt text


  • Download latest release zip file
  • In Arduino IDE, use Sketch -> Import Library -> Add Library command
  • Select the downloaded zip file


Include library in sketch and declare lcdKeypad variable:

#include <LiquidCrystal.h>
#include <LCDKeypad.h>

LCDKeypad lcdKeypad;

You can optionaly specify button analog pin (default A0) and backlight pin (default 10). Lcd pins are 8, 9, 4, 5, 6, 7. All the defaults pins can be changed by editing appropriate defines. You can also change button analog level values if default ones do not match your board.


LCDKeypad extends LiquidCrystal class so you can use all the functions from LiquidCrystal and following new ones:


Turn backlight off.


Turn backlight on.


Read the buttons. This function does not filter or debounce the buttons.


Read filtered button states. After detecting button press for the first time and returning appropriate code this function returns KEYPAD_BLOCKED until block_delay milliseconds has passed. If the button is held after this time its code is returned once and then function returns KEYPAD_BLOCKED again for repeat_delay milliseconds. Great for use in menus or similar situations where you need only one button press code.


© 2014-2018 Jindřich Doležy.

Based on the code by fj604 from

Licensed under the Apache License, Version 2.0

You can’t perform that action at this time.