Make KeyMatrix row output switch faster #5031
Merged
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.
KeyMatrix
was giving false readings with the NeoKey Ortho matrix, with the first column's key in most rows.This was extremely confusing for a while, because it seemed to be related to pulls not being set properly. But the problem was really that when the row is changed from an output back to an input, it took a little too long to switch levels, due to the relatively weak internal pull resistor. Adding a delay of even 1us fixed the problem. But the best fix is to flip the output value back to what the pull will be, before switching back to being an input. That allows the output to change quickly due to being actively driven instead of just being changed through a pull.
Another confusion was that the original code worked fine when
columns_to_anodes
wasTrue
. But for the NeoKey Ortho, it needs to beFalse
, and the time it takes to switch levels was perhaps a wee bit longer.@jepler you may wish to test this too if you are trying out the NeoKey.