Code Monkey home page Code Monkey logo

lcdkeypad's Introduction

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

Install

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

Usage

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.

Functions

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

lcdKeypad.noBacklight()

Turn backlight off.

lcdKeypad.backlight()

Turn backlight on.

lcdKeypad.button()

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

lcdKeypad.buttonBlocking(block_delay,repeat_delay)

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.

License

© 2014-2018 Jindřich Doležy.

Based on the code by fj604 from http://forum.arduino.cc/index.php?topic=38061.0

Licensed under the Apache License, Version 2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.