|
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
24 void keypad_setup(
int rowCount,
int columnCount,
int *rowPinCons,
int *columnPinCons,
int *buttonValues)
29 colIo = columnPinCons;
30 btnVals = buttonValues;
31 for(
int row = 0; row < rows; row++)
35 for(
int col = 0; col < cols; col++)
51 int row, col, rowStart, colStart;
52 int elements = rows * cols;
56 for(n = 0; n < elements; n++)
75 if(n == elements)
return -1;
77 for(col = 0; col < cols; col++)
low(colIo[col]);
78 for(row = 0; row < rows; row++)
input(rowIo[row]);
79 for(row = rowStart; row < rows; row++)
81 for(col = colStart; col < cols; col++)
84 state =
input(colIo[col]);
90 button = (row * cols) + col;
100 else return btnVals[
button];
void keypad_setup(int rowCount, int columnCount, int *rowPinCons, int *columnPinCons, int *buttonValues)
Set up the row and column dimensions, pins, and key values.
int keypad_read(void)
Returns the first key pressed, or -1 if no key is pressed.
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 ...
Scans matrix keypad and returns a unique value for each key that is pressed. For an example circuit a...