10.2 Transmit the Results

The temperature will be transmitted through USART. After reading the ADC value, the result will be converted to obtain the degrees Celsius corresponding value.
while (1)
{
    /* Read the conversion result */
    adcVal = ADC0_read();
    /* Convert the ADC result in degrees C */
    temp_C = temperatureConvert(adcVal);
    
    /* Transmit the ADC result to be plotted using Data Visualizer */
    USART1_Write(START_TOKEN);
    USART1_Write(temp_C & 0x00FF);
    USART1_Write(temp_C >> 8);
    USART1_Write(END_TOKEN);
}