2019-11-14 07:54 AM
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.
Solved! Go to Solution.
2019-11-15 12:23 AM
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)
2019-11-14 08:30 AM
So send as 4 bytes, or convert to a decimal ASCII format you can read, and send that.
2019-11-15 12:23 AM
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)