Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make KeyMatrix row output switch faster #5031

Merged
merged 1 commit into from
Jul 21, 2021

Conversation

dhalbert
Copy link
Collaborator

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 was True. But for the NeoKey Ortho, it needs to be False, 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.

@dhalbert dhalbert requested review from jepler and kattni July 21, 2021 13:10
Copy link

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully with the NeoKey Ortho Snap-Apart full sheet. Thanks for the fix!

@dhalbert dhalbert merged commit 626b06f into adafruit:main Jul 21, 2021
@dhalbert dhalbert deleted the keymatrix-scan-false-readings branch July 21, 2021 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants