Home

Awesome

Erriez LCD Keypad Shield library for Arduino

Build Status

This is a LCD Keypad Shield library for Arduino which supports the following features:

Hardware

Any Arduino board, tested on Arduino UNO.

LCD Keypad Shield

Pins

2x16 LCD pinsUNO/Leonardo/Mega2560
RS8
EN9
D04
D15
D26
D37
Backlight10

Example

Arduion IDE | Examples | Erriez LCDKeypadShield:

Documentation

Usage

Initialization

#include <ErriezLCDKeypadShield.h>

LCDKeypadShield shield;

Backlight control

Backlight on

shield.backlightOn();

Backlight off

shield.backlightOff();

Display control

All LCDKeypadShield.h functions can be used.

Clear display

shield.clear();

Set cursor

// First character first line
shield.setCursor(0, 0);

// First character second line
shield.setCursor(0, 1);

// Last character second line
shield.setCursor(15, 1);

Print text

shield.print(F("Push the buttons"));

Button control

Get buttons

LCDButtons button = shield.getButtons();
// Returned button enum:
//   ButtonNone
//   ButtonRight
//   ButtonUp
//   ButtonDown
//   ButtonLeft
//   ButtonSelect

Improve response

The resistors may be different for each board to read the analog key value. To improve response, experiment by updating the analogKey values in: src\ErriezLCDKeypadShield.cpp:

if (analogKey < 50) { /* <= Incread/decrease value 50 */
    key = ButtonRight;
} else if (analogKey < 200) { /* <= Incread/decrease value 200 */
    key = ButtonUp;
} else if (analogKey < 350) { /* <= Incread/decrease value 350 */
    key = ButtonDown;
} else if (analogKey < 500) { /* <= Incread/decrease value 500 */
    key = ButtonLeft;
} else if (analogKey < 750) { /* <= Incread/decrease value 750 */
    key = ButtonSelect;
} else {
    key = ButtonNone;
}

Library dependencies

Library installation

Please refer to the Wiki page.

Other Arduino Libraries and Sketches from Erriez