PRJ - Write Int Float With Pointer#

2024-05-29

void setup() {
  // put your setup code here, to run once:
  // float f1 = 14.3;
  // byte* fb = (byte*) &f1;
  
  long int f1 = 0x12345678;
  byte* fb = (byte*) &f1;
  

  Serial.begin(9600);

  Serial.println(fb[0], HEX);    // Take a look at the bytes
  Serial.println(fb[1], HEX);
  Serial.println(fb[2], HEX);
  Serial.println(fb[3], HEX);
//
  
  Serial.write(fb[0]);    // Take a look at the bytes
  Serial.write(fb[1]);
  Serial.write(fb[2]);
  Serial.write(fb[3]);}

void loop() {
  // put your main code here, to run repeatedly:

}