Direction Detection

The way to look at it is at the moment when A goes High if B is High also then CW Else if B is Low then CCW