//configuration part
TRISA=0x01; ADCON1=0xc0; //port A.0 ADC input
//adc read function
unsigned int read_adc()
{
unsigned int temp;
ADCON0=0x81; //read from ADC channel 1
__delay_ms(1); //setting time
ADGO=1; while(ADGO); // wait until ADC conversion complete
temp=(ADRESH<<8|ADRESL); // combine 10 bit result
return temp;
}
//display function
void lcd_number_display(unsigned int adc)
{
unsigned char a[5]={0,0,0,0,0},cnt=0;
if(adc==0) { cnt=1; }
while(adc)
{
a[cnt++]=(adc%10);
adc=(adc/10);
}
while(cnt--)
{
lcd_data((a[cnt]+'0')); //your single character display LCD function [ +'0' means add ascii value for display ]
}