here is some simple code reading a pot with adcin and it works fine:


vin var byte
compvalue var byte

main:

adcin porta.0, vin

if compvalue <> vin then serout porta.5,6,[#vin,10,13]

compvalue= vin

goto main



However the pot is a little jittery and I want to add a routine to allow for a slight variation in the input.


This is where I have had real problems

I thought this would work:

if compvalue > (vin + 1) then serout porta.5,6,[#vin,10,13]

But I get no result. There must be something really dumb I am missing!