leshow / rotary-encoder-hal

A simple platform agnostic rotary encoder library
MIT License
28 stars 15 forks source link

Add tests, fix the directions and missing attributes. #20

Closed ahmedcharles closed 1 year ago

ahmedcharles commented 1 year ago

The referenced article, multiple datasheets and local testing all suggest that the directions should be reversed.

leshow commented 1 year ago

Sorry I have not used this crate in some time, but do you mean this article? https://www.best-microcontroller-projects.com/rotary-encoder.html

I believe I got the directions from this section:

Screenshot from 2023-10-10 15-28-40

Is that not how it is already implemented? In any case, I'm not sure it would be responsible to merge a direction change at this point as anyone using the crate and updating could have counted on the direction being a specific way already.

ahmedcharles commented 1 year ago

Indeed, a is LSB and b is MSB, which was switched in the original implementation, probably to match the original implementation.

ahmedcharles commented 1 year ago

Anyways, would you like the tests without the direction change?

leshow commented 1 year ago

@ahmedcharles I see. Yeah, thanks! I'll take the tests

ahmedcharles commented 1 year ago

Thanks.