I have a wheel with magnets on it, passing on X2 hall effect sensors that I use to measure RPM.
I now want to know the direction of rotation but haven't got a clue on how to approach in the programming.
My idea is to place hall sensor A right next to hall sensor B.
If magnets first passes over A and immediately after passes over B then direction would be"right".
If magnets first passed over B and immediately after passes over A then direction would be "left".
Any idea how to put it in code?
Thanks a lot!