Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save urmil0071/554ba3d7f440449da9e6cd0bc651eec9 to your computer and use it in GitHub Desktop.
Save urmil0071/554ba3d7f440449da9e6cd0bc651eec9 to your computer and use it in GitHub Desktop.
Write C Codes to generate binary32 formatted data for a float (x=11.567)
#include <Arduino.h>
void setup()
{
union
{
uint32_t B32;
float Float;
}
floatb32;
Serial.begin(9600);
floatb32.Float=11.567;
Serial.println(floatb32.B32,HEX);
}
void loop()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment