6.2 Transmit the Results
The ADC differential conversion results can be read and transmitted, as presented in the code listing below.
while (1)
{
if (ADC0_conversionDone())
{
/* Read the ADC result */
adcVal = ADC0_read();
/* Transmit the ADC result to be plotted using Data Visualizer */
USART1_Write(START_TOKEN);
USART1_Write(adcVal & 0x00FF);
USART1_Write(adcVal >> 8);
USART1_Write(END_TOKEN);
}
}