program P16f88
' 8 Mhz internal OSC
Symbol LED = 0
Symbol POT = 0
dim count as word
main:
intcon=0 'interupt are disabled
ansel=%00000001 'an0 port is analog mode others are in digital mode. page 113
trisa=1 'port a0 is input others are output
trisb=0 'all port b are output
adcon0=%11000001 ' page 114
adcon1=%10000000 ' page 115
DO
count=adc_read(POT)
count=count
ClearBit(PORTB,LED)
VDelay_MS(count)
count=adc_read(POT)
count=count
SETBIT(PORTB,LED)
VDelay_MS(count)
LOOP until 1 = 0
end.