Oh ok, that's easier.

Assuming that has a 5v supply and A and B outputs then what I have in mind should work ok :) Do you have a link to datasheet?