5.2 Transmit the Results

The following algorithm must be implemented in the infinite loop to transmit the ADC conversion result:

while (1)
{
    /* Start the ADC conversion */
    ADC0_start();
    
    /* 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);
}