void main() { uint16 voltageCount; ADC_DelSig_1_Start(); /* Configure and power up ADC */ LCD_Char_1_Start(); /* Initialize and clear the LCD */ LCD_Char_1_Position(0,0); /* Move the cursor to Row 0 Column 0 */ /* Print Label for the pot voltage raw count */ LCD_Char_1_PrintString("Voltage : "); ADC_DelSig_1_StartConvert(); /* Force ADC to initiate a conversion */ while(1) { /* Wait for end of conversion */ ADC_DelSig_1_IsEndConversion(ADC_DelSig_1_WAIT_FOR_RESULT); voltageCount = ADC_DelSig_1_GetResult16(); /* Get converted result */ /* Set range limit */ if (voltageCount > 0x03FF) { voltageCount = 0x03FF; } else { /* Continue on */ } LCD_Char_1_Position(0,9); LCD_Char_1_PrintInt16(voltageCount); /* Print result on LCD */ } }