BenRotaryEncoder
Counts pulses from an incremental encoder and put the result in variable counter. Taking also into account the direction and counts down when the rotor rotates in the other direction.
This code is used attachInterrupt 0 and 1 which are pins 2 and 3 moust Arduino. For more information about attachInterrupt see: http://arduino.cc/en/Reference/AttachInterrupt
Demo on YouTube: https://www.youtube.com/watch?v=o84OYodjKKY
created 2014 by Ben-Tommy Eriksen