7.2 Transmit the Results

The ADC result must be read, divided by the number of samples, and transmitted through USART as presented below:
while (1)
{
    /* Read the ADC result */
    adcVal = ADC0_read();
    /* divide by No of samples or 16, if No. samples > 16 */
    adcVal = adcVal >> ADC_SHIFT_DIV16;
    /* 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);
}