Uhm, use circular buffer correctly so we actually read latest data...
Some corrections to mouse speed sensor