reading a digiswitch

hello there,

i am having problems reading a digiswitch (rotary knob) accurate. i know the notes about the rotary knob from the playground but i do not have accurate readings with the code example. while turning the knob, the 'encoder0Pos' variable shows a jumping behaviour. it should count up, but somtimes it counts one or two numbers down despite i did not change the turning direction.

also i do not understand the interrupt function and the relation with the waveform diagram shown in on the playground.

here is a link to the knob i use: