5
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 saved in the memory of the microcontroller. On the interface, in C# I am using for example:
double referencia = 125.6589;
byte[] byteArray = BitConverter.GetBytes(referencia);
Then send this sequence of bytes "byteArray". To the microcontroller.
But how can I use this byte sequence to reconstruct this reference value, which I will need to use on the microcontroller?
On the microcontroller I need to find a float:
float referencia = 125.6589;
Using that byte sequence to get that value. What mathematical operation can I use to get that value.
obs. The microcontroller is a PIC, programmed in C.