miketeachman / micropython-rotary

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

Added the ability for encoders with half steps. #9

Closed dsiggi closed 3 years ago

dsiggi commented 3 years ago

Hi, I'm added the abilitya to use encoders with half steps.

Example:


import time
from rotary_irq_esp import RotaryIRQ

r = RotaryIRQ(pin_num_clk=12, 
              pin_num_dt=13, 
              min_val=0, 
              max_val=5, 
              reverse=False, 
              range_mode=RotaryIRQ.RANGE_WRAP,
              half_step=True)
miketeachman commented 3 years ago

Hi Daniel, Thanks for taking the time to make this pull request! I don't own a 1/2 step encoder but I tested the PR and confirmed it doesn't change the existing behaviour of a full step encoder.

I'd like to purchase a 1/2 step encoder. Can you recommend one for me?

Regards, Mike

dsiggi commented 3 years ago

Hi, I bought my encoders on ebay years ago. They are from Alps, but I don't know the part number.

Daniel

miketeachman commented 3 years ago

Thanks. I'll check them out.