Reading analog input pic18
I found out the problem was that my reference was not set correctly in the OpenADC() function. I needed ADC_REF_VDD_VSS instead of ADC_VREFPLUS_VDD. Here is the correct way to read an A/D value. This part goes inside the while(1) loop shown in the question.

// Constraints: A/D acquisition time must be &gt;= 2.4 us (data sheet p264, Equation 20-3), conversion time (Tad) must be &gt;= 0.7 us (data sheet p385, Table 26-26)
// Given that our Fosc = 4 MHz, which means Tosc = 1/Fosc = 1/4 MHz = 0.25 us,
// we must have at least 4 * Tosc = 1 us of conversion time (Tad).
// This is why we choose ADC_FOSC_4.
// Since Tad = 1 us, and we need a minimum acquisition time of of 2.4 us,
// we choose acquisition time to be 4 * Tad, which is ADC_4_TAD
// Use channel 0 (ADC_CH0) to read AN0
OpenADC(ADC_FOSC_4 &amp; ADC_RIGHT_JUST &amp; ADC_4_TAD, ADC_CH0 &amp; ADC_INT_OFF &amp; ADC_REF_VDD_VSS, 0);
Delay10TCYx( 5 );        // allow for time to open adc (don't know if need this much)
ConvertADC();            // initiate conversion of sensor1 @ AN0
while(BusyADC());        // waiting to complete conversion
myVoltage = ReadADC();  // read A/D value. math needs to be done to convert to voltage
CloseADC();