Skip to main content
mmika.1330
Associate
November 14, 2019
Solved

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

  • November 14, 2019
  • 2 replies
  • 728 views

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.

This topic has been closed for replies.
Best answer by mmika.1330

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)

2 replies

Tesla DeLorean
Guru
November 14, 2019

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
mmika.1330
mmika.1330AuthorBest answer
Associate
November 15, 2019

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)