cancel
Showing results for 
Search instead for 
Did you mean: 

How to send ADC value to serial port via UART.

sangarius
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3

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
Up vote any posts that you find helpful, it shows what's working..
sangarius
Associate II

Thank you so much!

Thank you so much!