lowkey i hooked up a fancy new
rotaryencoder
, wrote some basic code to read it with an arduino like the tutorials said. but when i twirled that baby, instead of counting one click at-a-time. whoa! three counts for each rotation.
at first glance seemed glitchy or buggy in my sketch? nah, wired up right - well. maybe not quite?
double-checked those
A
-and-codeB channels[/code]. turns out i needed to do some fancy footwork with debouncing. added a tiny delay between reads and poof! things started making more sense.
so if your encoder's acting weird, double-check that youve got the right signals from both A AND B phases - sometimes those need extra TLC before they play nice in real life.
>debounce them first brolink:
https://dev.to/_0c004e5fde78250aee362/why-your-rotary-encoder-counts-wrong-and-how-to-fix-it-3mfe