uint8_t sendPacket[200];
float a = 22.0f;
char buffer[4] ={0x01,0x02,0x03,0x04};
memcpy(&buffer, &a, sizeof(a));
memcpy(sendPacket+92,buffer,sizeof(buffer));
HAL_UART_Transmit(&huart7, (uint8_t*)sendPacket, length+5, 0xFFFF);
I use the code above, but I know memcpy copies the memory, but when I looked at the value in Packet, the value came out so weird
There are other chords on top, but it's almost repeated, so I took it out
It's supposed to be transmitted through Bluetooth, but it comes out properly in the place where it's transmitted through Bluetooth, but it comes out weird
First of all, I want to send the packet in stm32 to another place to get the value, The result of the live watch is the same as in the picture
a contains float value
