he he It work fine Darrel !!

perhaps a another question,the optical coder has only one output TTL.
I count the pulses with the pin RB0/INT but how to know if it turns in a direction or the other?