void Voltage (void)
{
char line[16];
int Vref = 5000.0; //Converts reading from ADC to mV
double ADCBubbleV, BubbleV;
int bADCVal, BubbleVi;
SetChanADC(ADC_CH6);
XLCDDelay4ms ();
ConvertADC(); // Start conversion
while( BusyADC() ); // Wait for completion
XLCDDelay4ms ();
bADCVal = ReadADC(); // Read ADC
ADCBubbleV = ((bADCVal/1024.0) * Vref);
XLCDDelay4ms ();
BubbleV = ((ADCBubbleV)/(204.0));
XLCDDelay4ms ();
XLCDL2home();
XLCDPutRomString("Bubble (V): ");
BubbleVi = (int)BubbleV;
sprintf(line,"%d",BubbleVi);
XLCDPutRamString(line);
XLCDPutRomString(" ");
XLCDDelay4ms ();
}