Hi guys,
This has probably been tackled before but I haven’t found anything yet and I’m unfortunately in a bit of a rush.
I have a rotary encoder but unfortunately it’s not the kind I’ve come across before which cycles through the standard 00, 01, 11, 10 in quarters (notches on 00, notches on 01 etc).
Instead it has thin spiderleg conductors which pulse the A and B “switches” slightly out of sync. So it notches on 00 then sweeps across 01, 11, 10 and back to 00 for the next notch.
Now, I’m just looking to write a brief function to give me CW or CCW depending on which order it fires in.
I figured I could write (in basic pseudo):
If A or B high
If A high
Dir = CW
Else
Dir = CCW
else Dir = None
If that makes sense? Doesn’t work though. I thought it’d pick up the riding edge (00→01 or 10) but no luck.
Any tips or pointers?
Many thanks ![]()