Code: Select all
program ADC
symbol A1=portb.0
symbol B1=portb.1
symbol C1=portb.2
symbol D1=portb.3
main:
TRISA=%11111111
TRISB=%00000000
ADC_Init
A1=0
B1=0
C1=0
D1=0
loop:
if ADC_read(2) <= 205 then
A1=0
B1=0
C1=0
D1=0
else
end if
if ADC_Read(2) <= 410 then
A1=1
else
end if
end.