This sorta conflicts
adcon1.0 = 1 : adcon1.3 = 1 'set porte pins digital
With This
ADCON1 = 0 'set analogue inputs
ADCON1.7 = 1 'right justified for 10 bit ADC
But the last two lines should be OK. See register 11-2 in the data sheet.
Not sure I follow this:
ADCIN 0, avoltage 'read running voltage
if avoltage > bvoltage + 1 then 'detect vehicle start
avoltage will not be greater than 1023.. 10 bit
Then there is this
bvoltage = 65533





Bookmarks