RuiViana

float_to_array.ino

Sep 29th, 2018
162
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float fval = 1.475;
  2. byte* array = (byte*) &fval;
  3.  
  4. void setup ()
  5. {
  6.  Serial.begin (9600);
  7.  for (int i = 0; i < 4; ++i) {
  8.    Serial.println (array [i], HEX);
  9.  }
  10. }
  11.  
  12. void loop ()
  13. {}
RAW Paste Data