PaulStoffregen / Encoder

Quadrature Encoder Library for Arduino
http://www.pjrc.com/teensy/td_libs_Encoder.html
561 stars 243 forks source link

Counts by multiples of 2 #45

Open rafununu opened 5 years ago

rafununu commented 5 years ago

It works pretty fine for me except that it returns pulses by pairs, so I can't stop the encoder on an impair value. That is for sure due to the cheap chinese encoders I use, otherwise I think somebody else would have report about that much before.

Anyway, this isn't a real issue, I simply divide the return number by 2 !

The Arduino librairie is still 1.41.

Thanks all for your work.

Cheers.

magic-mouse commented 4 years ago

I can confirm this, except mine is multiplied by 4.

ondras12345 commented 4 years ago

Hi, see https://github.com/PaulStoffregen/Encoder/issues/26 - this behavior is normal with certain types of rotary encoders.

Ipk4Fun commented 3 years ago

It works pretty fine for me except that it returns pulses by pairs, so I can't stop the encoder on an impair value. That is for sure due to the cheap chinese encoders I use, otherwise I think somebody else would have report about that much before.

Anyway, this isn't a real issue, I simply divide the return number by 2 !

The Arduino librairie is still 1.41.

Thanks all for your work.

Cheers.

I pretty new to coding and can't figure out how to divide the return value, could you help me out? Thanks!

PaulStoffregen commented 3 years ago
myEnc.read() / 2;