Skip to main content
sangarius
Associate II
Oct 20, 2020 9:50 AM UTC
Solved

How to send ADC value to serial port via UART.

I'm getting value from LM35 sensor and i am converting it to celcius. Then I am trying to send it to serial port via UART but i couldn't do it. What codes should i use to convert data to bits. Thanks.

    This topic has been closed for replies.
    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    Oct 20, 2020 9:59 AM UTC

    char str[16];

    HAL_UART_Transmit(&huart1, (uint8_t *)str, sprintf(str, "%d\n", adcvalue), 0xFFFF);

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

    3 replies

    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    Oct 20, 2020 9:59 AM UTC

    char str[16];

    HAL_UART_Transmit(&huart1, (uint8_t *)str, sprintf(str, "%d\n", adcvalue), 0xFFFF);

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    sangarius
    sangariusAuthor
    Associate II
    Oct 20, 2020 10:31 AM UTC

    Thank you so much!

    sangarius
    sangariusAuthor
    Associate II
    Oct 20, 2020 10:31 AM UTC

    Thank you so much!