If you run one output into the D input of a flip flop and the other output into the clk of the same flip flop; then the flip flop output will be direction. Then pick either input and input it to an up down counter that you clear each time you poll it. You can poll this less often so it won't be as software intensive. Just another way of doing it.