You can Find the code for reading a two channels optical encoder (in quadrature) @ http://www.picbasic.co.uk/forum/showthread.php?t=12911

Post 28 or 27.

Cheers

Al.