Skip to content
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

Merged
merged 1 commit into from
Jun 22, 2015

Conversation

gooligumelec
Copy link
Contributor

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.

ladyada added a commit that referenced this pull request Jun 22, 2015
Added getKeys() method to read key presses recorded by HT16K33 keyscan
@ladyada ladyada merged commit 2c9ffd7 into adafruit:master Jun 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants