Usually that's a problem with the hardware, particularly the rotary encoder. Can you verify it's not a hardware problem?
_________________________
~ John