Encoder and Interrupts

Part of the trick using interrupts is doing as less as possible in the interrupt routine. Be sure not to use a Serial.print() as these take far too long.
Second, declare the variables used in the IRQ as volatile, to prevent the compiler to optimize access.