void adc_init()
{
TRISA0=1;
ADCON0=0b10000001; //check the significance of each bits in datasheet and modify according to ur need
ADCON1=0b10001110;//check the significance of each bits in datasheet and modify according to ur need
}
void read_adc()
{
ADGO=1;
while(ADGO);
readdata=ADRESH; //readdata must be defined as int
readdata<<=8;
readdata|=ADRESL;
}