This repository was archived by the owner on Sep 30, 2019. It is now read-only.
Added getKeys() method to read key presses recorded by HT16K33 keyscan #122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although the HT16K33 (the "LEDBackpack") is commonly used to drive LEDs, it is also able to scan keys arranged in a 13 x 3 matrix.
I needed to be able to read some jumpers (just like keys, but always on or off) to a HT16K33-based display project I'm working on, so I added a "getKeys()" method to Adafruit_LEDBackpack, which returns the current key scan result for a given row of 13 keys, as a 13-bit value where a '1' indicated a (debounced) key press since the last read. Note that if a key remains pressed, it will continue to be seen (return a '1') in subsequent scans.
For example, if keys 3 and 5 in row 0 have been pressed, getKeys(0) will return 0b0000000010100.