Go Down

Topic: encoder driving me crazy, help (Read 957 times) previous topic - next topic

dc42

The interface to that encoder library appears to me to be rather unhelpful, because it assumes you want to control a full 32-bit value, whereas in practice you always want to limit the range of the variable that the encoder controls. My own encoder library (at https://github.com/dc42/arduino) doesn't return an absolute value, instead it returns the number of clicks that the encoder has rotated since you last made a call to it, so that you can apply your own limits.

If you do want to use that library that you linked to, then I suggest you do what has already been suggested, i.e. keep track of the last value you read from it so that you can calculate the change between readings.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

joey120373

Quote
The interface to that encoder library appears to me to be rather unhelpful, because it assumes you want to control a full 32-bit value, whereas in practice you always want to limit the range of the variable that the encoder controls. My own encoder library (at https://github.com/dc42/arduino) doesn't return an absolute value, instead it returns the number of clicks that the encoder has rotated since you last made a call to it, so that you can apply your own limits.

If you do want to use that library that you linked to, then I suggest you do what has already been suggested, i.e. keep track of the last value you read from it so that you can calculate the change between readings.


Thanks, I downloaded your library, I  will try it in the morning.

Go Up