If statement refreshing

As advised in the topic: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum
Post links to the datasheets of the devices You refer to.
Make a test code just exercising the encoder.