The following example programs are available to demonstrate the basic principles of using the A/D converter on a PIC18F4620:
Example that measures an analog voltage on PORTA RA0 (AN0) and displays the result on 8 LEDs.
Example that measures an analog voltage on PORTA RA0 (AN0) and displays the result on the LCD as a 10-bit value (0-1023).
The same as ex2_analog_lcd.c, but reads multiple analog inputs from RA0(AN0), RA1(AN1), RA2(AN2), RA3(AN3)
The same as ex2_analog_lcd.c, but reads 20 samples, calculates the result and displays this "smoothed" out value. In the previous example the analog value would jump around a bit due to noise.
Example that measures an analog voltage on PORTA RA0 (AN0) and displays the result on the LCD as a voltage value (float 0.00 - 5.00).