Rotary Encoder with error compensation

I have been working on a new rotary encoder system with error correction up to 4 ticks, which is the max possible with index-less components.

You can download the sketch from the link below

I have been trying it, but I haven t been able to properly test it without an arduino :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: (waiting them from sparkfun), so trying it has been really lame.

I would appreciate if you could give it a try.
I have added comments that explain the code, and added many serial dumping too.

Any corrections, pointers would be much appreciated.

The next version will include more error correction, even with indexless devices, though a hall sensor + magnet on the rotor.