I have an interface that sends a reference value to a microcontroller. I need to send the values in bytes because these values will be stored in the memory of the microcontroller. In the interface, in C # I'm using for example:
double referencia = 125.6589;
byte[] byteArray = BitConverter.GetBytes(referencia);
Then I send this byteArray byte sequence. For the microcontroller.
But how can I use this byte sequence to reconstruct this reference value, what will I need to use in the microcontroller?
In the microcontroller I need to find a float:
float referencia = 125.6589;
Using that byte sequence to get this value. What mathematical operation I can use to get this value.
Obs. The microcontroller is a PIC, programmed in C.