Class for interfacing GPIO with a diode-multiplexed keypad.
More...
#include <Adafruit_Keypad.h>
|
| Adafruit_Keypad (byte *userKeymap, byte *row, byte *col, int numRows, int numCols) |
| default constructor More...
|
|
| ~Adafruit_Keypad () |
| default destructor
|
|
void | begin () |
| set all the pin modes and set up variables.
|
|
void | tick () |
| read the array of switches and place any events in the buffer.
|
|
bool | justPressed (byte key, bool clear=true) |
| check if the given key has just been pressed since the last tick. More...
|
|
bool | justReleased (byte key) |
| check if the given key has just been released since the last tick. More...
|
|
bool | isPressed (byte key) |
| check if the given key is currently pressed More...
|
|
bool | isReleased (byte key) |
| check if the given key is currently released More...
|
|
int | available () |
| check how many events are in the keypads buffer More...
|
|
keypadEvent | read () |
| pop the next event off of the FIFO More...
|
|
void | clear () |
| Clear out the event buffer and all the key states.
|
|
Class for interfacing GPIO with a diode-multiplexed keypad.
◆ Adafruit_Keypad()
Adafruit_Keypad::Adafruit_Keypad |
( |
byte * |
userKeymap, |
|
|
byte * |
row, |
|
|
byte * |
col, |
|
|
int |
numRows, |
|
|
int |
numCols |
|
) |
| |
default constructor
- Parameters
-
userKeymap | a multidimensional array of key characters |
row | an array of GPIO pins that are connected to each row of the keypad |
col | an array of GPIO pins that are connected to each column of the keypad |
numRows | the number of rows on the keypad |
numCols | the number of columns on the keypad |
◆ justPressed()
bool Adafruit_Keypad::justPressed |
( |
byte |
key, |
|
|
bool |
clear = true |
|
) |
| |
check if the given key has just been pressed since the last tick.
- Parameters
-
key | the name of the key to be checked |
clear | whether to reset the state (default yes) post-check |
- Returns
- true if it has been pressed, false otherwise.
◆ justReleased()
bool Adafruit_Keypad::justReleased |
( |
byte |
key | ) |
|
check if the given key has just been released since the last tick.
- Parameters
-
key | the name of the key to be checked |
- Returns
- true if it has been released, false otherwise.
◆ isPressed()
bool Adafruit_Keypad::isPressed |
( |
byte |
key | ) |
|
check if the given key is currently pressed
- Parameters
-
key | the name of the key to be checked |
- Returns
- true if it is currently pressed, false otherwise.
◆ isReleased()
bool Adafruit_Keypad::isReleased |
( |
byte |
key | ) |
|
check if the given key is currently released
- Parameters
-
key | the name of the key to be checked |
- Returns
- true if it is currently released, false otherwise.
◆ available()
int Adafruit_Keypad::available |
( |
| ) |
|
check how many events are in the keypads buffer
- Returns
- the number of events currently in the buffer
◆ read()
pop the next event off of the FIFO
- Returns
- the next event in the FIFO
The documentation for this class was generated from the following files: