#include"adc.h"unsignedintAdc_Read(unsignedintchannel){ADFM=1;// results right justifiedADCS0=1;//conversion speed = 64*ToscADCS1=1;ADCS2=1;ADCON0bits.CHS=channel;ADON=1;// Turn on ADC__delay_ms(1);GO_DONE=1;while(ADCON0bits.GO_DONE==1);return((ADRESH<<8)+ADRESL);// ex 1024}