You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Mike,
Firstly, thanks for an excellent MicroPython library for the rotary encoder. So many resources use Circuit Python or Arduino only, so it's great to come across this!
My issue is that I'm using an MCP 23017 to extend the number of GPIO pins. This is because I'm using a Pico to drive an LED matrix and almost all the GPIOs are used for this purpose. I have an adafruit 23017 GPIO extender board working on I2C (using QWIIC connection).
I address the pins like this (where x is the pin number I'm addressing):
My tiny brain can't work out a way to use these extended GPIO pins with your Rotary Encoder module. Is this possible?
Interrupts on the extender are through 2 pins (INTA works with the first 8 pins and INTB for the second 8). I assume I need to connect these interrupt pins to a spare GPIO on the Pico itself in order to get interrupts to work?
Many thanks
Dave
The text was updated successfully, but these errors were encountered:
Hi Dave,
Unfortunately, I can't see a way to use a GPIO extender with this library. Internally, this Rotary library uses the MicroPython Pin class which requires direct access to the microprocessor pins. As far as I know there is no way to map a Pin class object to the GPIO extender library. It's a similar problem that is discussed in this issue #24. I suggest trying to find an encoder library that uses polling techniques, rather than the interrupt techniques that are used in this library. A library that uses polling can be adapted to poll pin values from the GPIO extender. The downside to polling approach is a much slower response when the encoder is turned. Clicks will be missed if the encoder is turned too quickly.
Hope this helps!
Mike
Hi Mike,
Firstly, thanks for an excellent MicroPython library for the rotary encoder. So many resources use Circuit Python or Arduino only, so it's great to come across this!
My issue is that I'm using an MCP 23017 to extend the number of GPIO pins. This is because I'm using a Pico to drive an LED matrix and almost all the GPIOs are used for this purpose. I have an adafruit 23017 GPIO extender board working on I2C (using QWIIC connection).
I address the pins like this (where x is the pin number I'm addressing):
mcp = mcp23017.MCP23017(i2c, 0x20)
mcp.pin(x, mode=1, pullup=True)
My tiny brain can't work out a way to use these extended GPIO pins with your Rotary Encoder module. Is this possible?
Interrupts on the extender are through 2 pins (INTA works with the first 8 pins and INTB for the second 8). I assume I need to connect these interrupt pins to a spare GPIO on the Pico itself in order to get interrupts to work?
Many thanks
Dave
The text was updated successfully, but these errors were encountered: