miketeachman / micropython-rotary

MicroPython module to read a rotary encoder.
MIT License
269 stars 56 forks source link

Can not detect the initial state of half step rotary encoder correctly #35

Open scarrrr316 opened 1 month ago

scarrrr316 commented 1 month ago

The problem is that the code is unable to detect the initial state correctly, causing fail detection of the first half-step.

The way I solved the problem was to add this line:

self._process_rotary_pins(None)

to the end of the __init__ function of the RotaryIRQ class.

I don't know how it works, but it works.