I ran into an issue with trying to use a rotary encoder through a GPIO expander module. These modules often give you access to their pins in the form of digitalio.DigitalInOut objects. I made a small adjustment to the Encoder module in KMK to support a pin being some form of DigitalInOut object rather than a microcontroller.Pin object.
Description of Change
Check if pin is a microcontroller.Pin. If it is, keep the old logic of turning it into a digitalio.DigitalInOut object. If it isn't, just assume it's already a DigitalInOut object and use it as is.
Background
I ran into an issue with trying to use a rotary encoder through a GPIO expander module. These modules often give you access to their pins in the form of digitalio.DigitalInOut objects. I made a small adjustment to the Encoder module in KMK to support a pin being some form of DigitalInOut object rather than a microcontroller.Pin object.
Description of Change
Check if pin is a microcontroller.Pin. If it is, keep the old logic of turning it into a digitalio.DigitalInOut object. If it isn't, just assume it's already a DigitalInOut object and use it as is.