Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You have p as type uint8_t, when the data inside is of type float. You should declare it as a pointer of type float and cast the pointer you get from .data

As it is, you are accessing the 8 bits as a uint8, then converting that to a float, which is of course, wrong. You need to access the full 32 bits as a float.