2021-04-08 04:49 AM
2021-04-08 05:16 AM
The data representation of a 32-bit float is contained in 4-bytes, you could send the data as a collection of 4 bytes.
You might want to put the data within a larger data structure you can synchronize and validate on the receiving end.
One could perhaps learn how this works on a PC by saving and retrieving data from a file
float f = 1.2345f;
HAL_UART_Transmit(&hUart, (void *)&f, sizeof(float), 1000);
2021-04-08 06:26 AM
Hello, I tried, but the number is not gone, the letters are coming.
HAL_UART_Transmit(&huart2, (void*)&f, sizeof(float),HAL_MAX_DELAY);
HAL_Delay(300);
2021-04-08 11:27 AM
Ok, but I think that's more of a problem of not understanding the basics of data representation. And what you're asking.
It would help you significantly to learn some basic computer concepts and programming in C before embarking on embedded programming.
Going to assume you aren't familiar with binary representation, or exponent/mantissa concepts for floating point numbers. The computer isn't doing the math on ASCII decimal digits here.
IEEE-754 floating point https://en.wikipedia.org/wiki/IEEE_754
2021-04-08 11:36 AM
https://www.geeksforgeeks.org/convert-floating-point-number-string/