cancel
Showing results for 
Search instead for 
Did you mean: 

i use stm32cubeIDE my code: sprintf(mesaj, "xaccl = %3.3f /n ", xaccl); HAL_UART_Transmit(&huart6, mesaj, sizeof(mesaj), HAL_MAX_DELAY); how i can fix /n terminal problem? thanks for answers

VEnes.1
Associate

0693W00000QNYriQAH.bmp

3 REPLIES 3

Use the proper escape character, ie \n

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

Might also point out that sprintf returns the length of the generated string, and sizeof() isn't suitable for strings.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Bob S
Principal

And use snprintf() instead of sprintf(). Friends don't let friends use sprintf().