RotaryEncoder icon indicating copy to clipboard operation
RotaryEncoder copied to clipboard

getRPM() uses hard coded number of pulses per rotation and ignores LatchMode

Open ftjuh opened this issue 2 years ago • 2 comments

Hi Matthias and thanks for a great library.

If I'm not completely mistaken, getRPM() assumes an encoder with 20 pulses per Rotation:

return 60000.0 / ((float)(t * 20));

So without being able to set this number ourselves, this will be wrong in most cases. Also, I assume that LatchMode needs to be taken into account.

Jan

ftjuh avatar Feb 20 '23 21:02 ftjuh

@ftjuh : right analysis. Please create a pull request and check with your encoder.

mathertel avatar Oct 25 '25 15:10 mathertel

Sorry, but my project is long finished and I moved on. I would have to start entirely from scratch to be able to contribute and test anything useful.

ftjuh avatar Oct 26 '25 23:10 ftjuh