Arduino-LCD
LCD library for Arduino
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Keypad.ino
Go to the documentation of this file.
1
#include "GPIO.h"
2
#include "
LCD.h
"
3
#include "
Shield/LCD_Keypad.h
"
4
#include "
Shield/LCD4884.h
"
5
6
// Configure: LCD4884 or LCD_Keypad Shield
7
LCD4884
lcd
;
8
// LCD_Keypad lcd;
9
10
void
setup
()
11
{
12
lcd.
begin
();
13
lcd.print(F(
"Keypad: started"
));
14
}
15
16
void
loop
()
17
{
18
// Check that a key pad change
19
if
(!lcd.ischanged())
return
;
20
21
// Print the key name
22
lcd.
display_clear
();
23
switch
(lcd.key()) {
24
case
lcd.
NO_KEY
:
25
lcd.print(F(
"NO_KEY"
));
26
break
;
27
case
lcd.
SELECT_KEY
:
28
lcd.print(F(
"SELECT_KEY"
));
29
break
;
30
case
lcd.
LEFT_KEY
:
31
lcd.print(F(
"LEFT_KEY"
));
32
break
;
33
case
lcd.
DOWN_KEY
:
34
lcd.print(F(
"DOWN_KEY"
));
35
break
;
36
case
lcd.
UP_KEY
:
37
lcd.print(F(
"UP_KEY"
));
38
break
;
39
case
lcd.
RIGHT_KEY
:
40
lcd.print(F(
"RIGHT_KEY"
));
41
break
;
42
default
:
43
lcd.print(lcd.key());
44
}
45
46
// Print key number and timestamp when pressed
47
lcd.
cursor_set
(0, 1);
48
lcd.print(lcd.key());
49
lcd.print(
':'
);
50
lcd.print(lcd.timestamp());
51
}
PCD8544::display_clear
virtual void display_clear()
Definition:
PCD8544.h:273
LCD4884::SELECT_KEY
Definition:
LCD4884.h:41
LCD4884::UP_KEY
Definition:
LCD4884.h:38
PCD8544::cursor_set
virtual void cursor_set(uint8_t x, uint8_t y)
Definition:
PCD8544.h:286
lcd
LCD4884 lcd
Definition:
Keypad.ino:7
LCD4884::begin
virtual bool begin()
Definition:
LCD4884.h:64
LCD4884::LEFT_KEY
Definition:
LCD4884.h:42
LCD4884::RIGHT_KEY
Definition:
LCD4884.h:39
loop
void loop()
Definition:
Keypad.ino:16
LCD_Keypad.h
LCD4884.h
LCD4884::NO_KEY
Definition:
LCD4884.h:37
LCD4884::DOWN_KEY
Definition:
LCD4884.h:40
LCD.h
LCD4884
Definition:
LCD4884.h:31
setup
void setup()
Definition:
Keypad.ino:10
examples
Keypad
Keypad.ino
Generated on Sat Oct 14 2017 03:06:11 for Arduino-LCD by
1.8.11