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

Use multiple rotary encoders with SN74HC165 as input expander #24

Open
Guustaaf opened this issue Mar 1, 2023 · 2 comments
Open

Use multiple rotary encoders with SN74HC165 as input expander #24

Guustaaf opened this issue Mar 1, 2023 · 2 comments

Comments

@Guustaaf
Copy link

Guustaaf commented Mar 1, 2023

Hi Mike,

I have a project where I want to use five rotary encoders. There are of course GPIO expander ICs such as the MCP23017 but to use that kind of chip would bring in a lot of unnecessary complexity since all we need are inputs. The SN74HC165 is a commonly available 8 bit parallel-load shift register. So I imagine chaining two SN74HC165s together and then at short intervals reading the 16 bit value that contains the 15 bits representing the pins of the five rotary encoders. I could come up with some ideas for how to then link this to the micropython-rotary library, bit perhaps the smarter way to go is to let the author himself lead the way.

Guustaaf

@miketeachman
Copy link
Owner

Unfortunately, a shift register will not work with this rotary encoder implementation. This module requires pin interrupts built into each microcontroller to detect changes in the encoder value. You might be able to find a different encoder library that uses polling techniques and then modify it to poll the shift register for changes in value.

@Guustaaf
Copy link
Author

Guustaaf commented Mar 4, 2023

OK, got it, thanks!

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

No branches or pull requests

2 participants