-
Notifications
You must be signed in to change notification settings - Fork 24
/
KeypadShield.h
51 lines (38 loc) · 911 Bytes
/
KeypadShield.h
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
42
43
44
45
46
47
48
49
50
51
/*
Project: 1Sheeld Library
File: KeypadShield.h
Version: 1.0
Compiler: Arduino avr-gcc 4.3.2
Author: Integreight
Date: 2014.5
*/
#ifndef KeypadShield_h
#define KeypadShield_h
#include "ShieldParent.h"
//Input Function ID
#define KEYPAD_VALUE 0x01
class KeypadShieldClass : public ShieldParent
{
public:
//Constructor
KeypadShieldClass();
//Checkers
bool isRowPressed(byte x);
bool isColumnPressed(byte x);
bool isAnyRowPressed();
bool isAnyColumnPressed();
//setOnChange for Users Function
void setOnButtonChange(void (*)(byte ,byte));
private:
//Reserve Variables
byte row;
byte col;
//Boolean For setOnChange Function
bool isCallbackAssigned;
//Process Input Data
void processData();
void (*buttonChangeCallback)(byte , byte);
};
//Extern Object
extern KeypadShieldClass Keypad;
#endif