hi all,
need help with sending adv values via UART ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-14 7: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.
- Labels:
-
ADC
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-14 8:30 AM
So send as 4 bytes, or convert to a decimal ASCII format you can read, and send that.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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)
