PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Scans matrix keypad and returns a unique value for each key that is pressed. For an example circuit and program, go to learn.parallax.com and look for a keypad example in the Simple Devices series. More...
#include "simpletools.h"
Go to the source code of this file.
Functions | |
void | keypad_setup (int rowCount, int columnCount, int *rowPinCons, int *columnPinCons, int *buttonValues) |
Set up the row and column dimensions, pins, and key values. More... | |
int | keypad_read (void) |
Returns the first key pressed, or -1 if no key is pressed. More... | |
int | keypad_getNumber (void) |
Get a number from the keypad. The number will be retured as soon as a non-numeric key is pressed and released. More... | |
int | keypad_getNumberEndKey (void) |
Get the key that terminated number received by keypad_getNumber. More... | |
int | keypad_readFrom (int button) |
If more than one key might be pressed and held at one time, use this keyapd_readFrom function to get the 2nd, 3rd, etc key. More... | |
Scans matrix keypad and returns a unique value for each key that is pressed. For an example circuit and program, go to learn.parallax.com and look for a keypad example in the Simple Devices series.
Definition in file keypad.h.
int keypad_getNumber | ( | void | ) |
Get a number from the keypad. The number will be retured as soon as a non-numeric key is pressed and released.
Definition at line 18 of file getNumber.c.
int keypad_getNumberEndKey | ( | void | ) |
Get the key that terminated number received by keypad_getNumber.
Definition at line 49 of file getNumber.c.
int keypad_read | ( | void | ) |
Returns the first key pressed, or -1 if no key is pressed.
Definition at line 42 of file keypad.c.
int keypad_readFrom | ( | int | button | ) |
If more than one key might be pressed and held at one time, use this keyapd_readFrom function to get the 2nd, 3rd, etc key.
button | Pass the value last returned by either keypad_read or keypad_readFrom. This function will start searching from one past that key in the scan order. |
Definition at line 48 of file keypad.c.
void keypad_setup | ( | int | rowCount, |
int | columnCount, | ||
int * | rowPinCons, | ||
int * | columnPinCons, | ||
int * | buttonValues | ||
) |
Set up the row and column dimensions, pins, and key values.
rowCount | Number of keypad rows. |
columnCount | Number of keypad columns. |
*rowPinCons | Array that stores the row connections (from top to bottom). |
*columnPinCons | Array that stores the column connections (from left to right). |
*buttonValues | Array that stores the values that should be returned for each key. |