<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1277&stc=1&d=116632121 9">
Have a look at the chart above, which shows the lower nibble of ADCON1 (it's in the datasheet in section 11). ADCON1 = $0F sets PORTA.2 (pin4 ) as the Vref-. Try ADCON1=$07. This will make all PORTA pins digital.
This should allow the Pot on PORTA.1 (pin 3) and the switch on PORTA.2 (pin4 ).
I haven't looked real closely at the rest of the code yet, but this should help.
SteveB
EDIT: I should have read up on the POT command (never had a use for it), so I had to make a couple of changes.
Bookmarks