-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLCDKeypad.h
More file actions
41 lines (35 loc) · 810 Bytes
/
LCDKeypad.h
File metadata and controls
41 lines (35 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
LCDKeypad.h - Library for reading key inputs from LCD Keypad
Debounce and repeat delay implemented
*/
#ifndef LCDKeypad_h
#define LCDKeypad_h
#include "Arduino.h"
//#include "LiquidCrystal.h"
#define Right 0
#define Up 1
#define Down 2
#define Left 3
#define Select 4
#define None 5
class LCDKeypad
{
public:
LCDKeypad(byte _keypadPin);
int read();
private:
const int _minPressTime = 70;
const int _repeatDelayTime = 500;
byte _keypadPin;
int interpretKey(int _rawKey);
int _rawKey;
byte _keyReading;
byte _keyPrevious;
byte _keyRegistered;
byte _keyRegisteredPrevious;
long _beginDebounceMillis;
bool _resetDebounceMillis;
long _beginRepeatDelayMillis;
bool _resetRepeatDelayMillis;
};
#endif