Erriez LCD Keypad Shield library for Arduino
1.1.0
This is a LCD Keypad Shield library for Arduino
src
ErriezLCDKeypadShield.h
Go to the documentation of this file.
1
/*
2
* MIT License
3
*
4
* Copyright (c) 2018-2020 Erriez
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to deal
8
* in the Software without restriction, including without limitation the rights
9
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
* copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in all
14
* copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
* SOFTWARE.
23
*/
24
33
#ifndef ERRIEZ_LCD_KEYPAD_SHIELD_H_
34
#define ERRIEZ_LCD_KEYPAD_SHIELD_H_
35
36
#include <Arduino.h>
37
#include <LiquidCrystal.h>
38
39
#if !defined(ARDUINO_AVR_UNO) && \
40
!defined(ARDUINO_AVR_LEONARDO) && \
41
!defined(ARDUINO_AVR_MEGA2560)
42
#warning "The library ErriezLCDKeypadShield has not been tested with this MCU"
43
#endif
44
45
// Hard-wired LCD pins in 4-bit mode:
46
#define LCD_PIN_RS 8
47
#define LCD_PIN_EN 9
48
#define LCD_PIN_D0 4
49
#define LCD_PIN_D1 5
50
#define LCD_PIN_D2 6
51
#define LCD_PIN_D3 7
52
53
// Backlight pin
54
#define LCD_BACK_LIGHT_PIN 10
55
56
59
typedef
enum
{
60
ButtonNone = 0,
61
ButtonRight = 1,
62
ButtonUp = 2,
63
ButtonDown = 3,
64
ButtonLeft = 4,
65
ButtonSelect = 5
66
}
LCDButton
;
67
71
class
LCDKeypadShield
:
public
LiquidCrystal
72
{
73
public
:
74
LCDKeypadShield
();
75
LCDButton
getButtons
();
76
77
void
backlightOn
();
78
void
backlightOff
();
79
};
80
81
#endif // ERRIEZ_LCD_KEYPAD_SHIELD_H_
LCDKeypadShield::backlightOff
void backlightOff()
Turn backlight LED off.
Definition:
ErriezLCDKeypadShield.cpp:114
LCDButton
LCDButton
LCD buttons.
Definition:
ErriezLCDKeypadShield.h:59
LCDKeypadShield
LCD Keypad Shield class.
Definition:
ErriezLCDKeypadShield.h:71
LCDKeypadShield::getButtons
LCDButton getButtons()
Read buttons from one analog pin.
Definition:
ErriezLCDKeypadShield.cpp:66
LCDKeypadShield::LCDKeypadShield
LCDKeypadShield()
Constructor LCDKeypadShield class.
Definition:
ErriezLCDKeypadShield.cpp:47
LCDKeypadShield::backlightOn
void backlightOn()
Turn backlight LED on.
Definition:
ErriezLCDKeypadShield.cpp:106
Generated by
1.8.13