@fabient
PRJC has a nice tutorial on quadrature encoders. You can find it here: https://www.pjrc.com/teensy/td_libs_Encoder.html. I have used quad encoders to measure motor speed and wheel speed as well as direction of motion in robotics. Here is nice little site to get you started: http://www.creative-robotics.com/quadrature-intro