An more full featured alternative to this library can be found as the MD_UISwitch_4017KM Class in the MD_UISwitch Libray found here.
This is a library to manage the keyswitch matrix implemented using a 4017 as described in the articles at
Using a 4017 IC, this library implements a method for reading many open/closed switches using only three digital I/O pins (Clock, Reset and DataIn}).
The library
- Allows definition of the size of the keyswitch matrix
- Manages the scanning of the 4017 to read the matrix
- Detects the transition from OFF state to ON state for each key
- Implements software enabled debounce and software auto repeat
Eagle CAD files for a 3x3 version of the matrix are included, as well as the articles referenced in the URL above.