cancel
Showing results for 
Search instead for 
Did you mean: 

hi all, need help with sending adv values via UART ?

mmika.1330
Associate II

i am trying to send my ADC values to my realterm terminal via UART, the HAL_UART AND hal_adc integer are not compatible, UART takes 8 bit and ADC 32 bit, can someone help ?

both ADC code and UART code are working fine in separate program.

1 ACCEPTED SOLUTION

Accepted Solutions
mmika.1330
Associate II

hi, thank you for your input, i used something different and it works,

casting the parameter is the best way ,

HAL_UART_TRANSMIT(&HUART, ADCVALUE, 2,10) using casting ........................... HAL_UART_TRANSMIT(&HUART, (uint8_t*)(&ADCVALUE),2,10)

View solution in original post

2 REPLIES 2

So send as 4 bytes, or convert to a decimal ASCII format you can read, and send that.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mmika.1330
Associate II

hi, thank you for your input, i used something different and it works,

casting the parameter is the best way ,

HAL_UART_TRANSMIT(&HUART, ADCVALUE, 2,10) using casting ........................... HAL_UART_TRANSMIT(&HUART, (uint8_t*)(&ADCVALUE),2,10)