An Encoder normally works like this.
1) Channel A is connected to a processor interrupt for LOW->HIGH transition.
2) When the interrupt is detected, the status of Channel B is read. If Channel B is LOW, this means that the encoder was turned one step in Clockwise. If Channel B is High, then the encoder was turned one step anticlockwise.
3) You can maintain a counter variable which counts +1 for each clockwise and -1 for each anticlockwise.
4) In the case of IE2-512, there are 512 encoder steps in 1 turn (360deg) of the encoder.
I hope this clarifies eveything.
-Karthik
