analog bcf ADCON0,CHS2 ;select analog channel 1
bcf ADCON0,CHS1
bsf ADCON0,CHS0
bsf ADCON0,GO ;go do a/d conversion
adloop btfsc ADCON0,DONE
goto adloop
movff ADRESH,temp ;get the value in temp
tstfsz temp ;is it 0?
goto stor1 ;yes, go put it in spdvr1
incf temp,F ;no, make it 1
stor1 movff temp,spdvr1 ;put it in spdvr1
call delay
bcf ADCON0,CHS2 ;select analog channel 3
bsf ADCON0,CHS1
bsf ADCON0,CHS0
bsf ADCON0,GO ;go do a/d conversion
adloop2 btfsc ADCON0,DONE
goto adloop2
movff ADRESH,temp ;get the value in temp
tstfsz temp ;is it 0?
goto stor2 ;yes, go put it in spdvr2
incf temp,F ;no, make it 1
stor2 movff temp,spdvr2
return