Gui float data from micro controller
How the value types are represented in memory depends on the architecture (little/big endian for example) and on the standards it complies to.

Example: The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation established in 1985.

From a micro controller perspective, the easiest way to send this kind of data is just to send it in this native (in memory) representation using pointers or unions.

On the PC/GUI side, you may have additional resources/libraries that help you with byte-sequence to type conversions. However you perform the conversion, you just have to make sure it uses the same rules/standard.

Lets take an 16-bit unsigned integer ´i´ with the assigned value of 1000 for example:

i = 1000


The little endian representation would be

0xE8 0x03


in memory. So when you want send this value as a serial byte stream just cast ´i´ to ´byte´ and send two bytes starting from that address.

Your GUI software could perform the cast in the other direction, given that it uses the same standard for the type representation. If it uses big endian, you may have to interchange byte order first.

btw: What kind of GUI/language are you referring to? For example C#/.NET provides extensive mechanisms for type conversions using the BitConverter class.

EDIT Since the author mentioned that he uses C#, here some additional info:
Note that C# itself doesn't define the endianness. Endianness is decided by hardware. However, most platforms that use .NET are LITTLE endian. If you want to be sure, you can check the endianness of the system with the ´BitConverter.IsLittleEndian´ field to tell you how it will behave.

Assuming that your micro controller uses little endian (like all(?) atmel controllers for example), you could convert the bytes given from the 16-bit unsigned int example above using:

    UInt16 value = BitConverter.ToUInt16(new byte[] { 0xE8, 0x03 }, 0);


Otherwise, you may have to revert the byte order first.