unsigned short adc_val ; // use to store digital value
void main ()
{
ADCON1 = 0x00; // check PIC18 datasheet and set particular bits for ADC
ADCON0 = 0x00; // same as above
TRISA = 0xff ; // set portA as input
TRISB = 0;
while (1)
{
adc_val = adc_read(0) ; //adc_read(x) is mikroC built-in func while x is
// port number. Eg, read from AD0 pin
portb =adc_val ; // for you to figure out:)
}
}