‎2023-05-30 01:31 PM
Hello,
My aim is to send (from my nucleo board_F103+FTDI) somes ADC value from DMA.
Easy...
But i would like a frame like that (Windows Software need it):
<STX>ADC1;ADC2;ADC3<ETX><CR><LF>
I'm able to send data, no more...
uint16_t sensor_B =1234;
char str[10];
sprintf(str, "%u\r\n", sensor_B);
HAL_UART_Transmit_DMA(&huart1, (uint8_t*)str, strlen(str));
Do you know the simplest way to do that ?
Solved! Go to Solution.
‎2023-05-30 01:38 PM
sprintf returns a string length
char str[64];
HAL_UART_Transmit_DMA(&huart1, (uint8_t*)str, sprintf(str, "\x02%u;%u;%u\x03\r\n", sensor_A, sensor_B, sensor_C));
‎2023-05-30 01:38 PM
sprintf returns a string length
char str[64];
HAL_UART_Transmit_DMA(&huart1, (uint8_t*)str, sprintf(str, "\x02%u;%u;%u\x03\r\n", sensor_A, sensor_B, sensor_C));
‎2023-05-30 01:46 PM
Definitely, you saved my day.
my brain is no longer available...:>