mathertel / RotaryEncoder

RotaryEncoder Arduino Library
Other
328 stars 107 forks source link

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

Open ftjuh opened 1 year ago

ftjuh commented 1 year ago

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