OOo I get the digital part now, no need for ADC.
I have never used interrupt, can you explain the code snippet you provided above?
should this work?
Mainloop:
'Calculate the distance
Output_Pot = PortB.3
if OldOutput_Pot == Output_Pot then
goto Mainloop
endif
if OldOutput_Pot != Output_Pot then
counter = counter +1 'If oldOutput_pot is different then Output_pot
OldOutput_Pot = Output_Pot
if counter =4 then
Revolution = Revolution + 1
counter =0
endif
endif
lcdout $FE,1, "Counter:",dec counter
lcdout $FE,$C0, "Revolution:",dec Revolution
pause 150
GOTO Mainloop
end
ken





Bookmarks