Let's Make Robots!


Need to count state changes on rotary encoder

I recently added a rotary encoder to a hacked servo.

I'm trying to count the number of state changes (Channel A or Channel B), so I can use this to determine how far the encoder has rotated.

Arduino code posted below.


Hi LMR...          I think that you often run into the problem with MCU that when you press a button it read it not only one time but often even 50 times or … Read more