Hello,

Sorry for the late reply, it is nothing complicated like that. it is just 6 optical switches mounted on the rotor therefore 6 inputs on my pic that gives me a truth table. (in function of the inputs ON or OFF, I know what phases of the motor I need to turn ON/OFF).
For the clockwise rotation, it goes like this :
000000
000001
000011
000111
001111
011111
111111
111110
111100
etc

and for anti clockwise it goes like this :
000000
100000
110000
111000
111100
111110
111111
111110
111100
etc, as you can see for anti clockwise I am getting the same values but it is not the same phases ON, I need to turn ON (for 360 mechanical degrees, I have 3 times these 12 "cases").


Otherwise you'll simply need to check the state of the switch as often as you need to
Can you give me a simple example ?

Many thanks again for your answers