detection of clockwise or counterclockwise direction. RESOLVED
Hello.
I'm having trouble triggering a CW or CCW button depending on the direction of a 32 steps dial
Specifically when dial goes from 31 to 0 or 0 to 31, I would like no changes in the direction
In the patch below, CW or CWW is triggered but there is a a normal problem when I go from 31 to 0 or from 0 to 31.

Thanks in advance !
something like this
Oh thanks a lot!
I couldn't imagine the solution by myself!
I am very grateful to you!
Thanks again! I have to test your system in my real use.
You forgot to tell the whole story - puzzle.
In your patch that endless dial/rotator is a product of several input additions passed through modulo % 32. and set to move in either CW or CCW direction.
It is a float and has range 0. ~ 32. not 31.
That summed inputs could produce value well higher then 32, and so dial
could jump to lower then previous value, even if set to turn CW.
which would actually count as CCW movement if one uses inc/dec detector...
From that you want to count how many times dial turned in either direction,
respecting set CW or CCW switch, but want to ignore that "jumps over limit"
in order to align 10 motors positions to jumped value using shorter path.
for example:
if value jumped from 25 to 20 while set to move CW,
it is clear that 20 is product of 25 + input 27

dial will jump to 20,
but you want motor to move 5 steps backward - CCW,
because it is faster to align it so to the dial value.
I don't know if that would work well in real world, but here is patch doing what you want

Hi.
Very happy to see your answer.
I integrated to my all patch and it's work well!
I past the patch on other post. I hope you will not see to much big little silly things ;)