Here anolog value reads from channel 0 and it will display on the LCD
void main()
{
float i;
char a[13];
adcon1=0x80;
lcd_init(&portd);
lcd_cmd(lcd_cursor_off);
while(1)
{
i=adc_read(0)*.00488;
floattostr(i,a);
lcd_out(1,1,a);
lcd_out(1,5," ");
delay_ms(500);
}
}
The value written to ADCON1 is hexadecimal: 0x80 is 1000 0000 in binary, so only the top bit is set. A hex to binary converter makes it easy to check which register bits a value like this sets, and the hex to decimal tool gives the plain number (0x80 = 128).