TWI/I2C - Arduino to Arduino, sending float

This is the general idea without using the template function. Much shorter and easier to read don't you think?

#include <Wire.h>

const byte slaveAddress = 2;
const byte dataCount = 6;

union
  {
  float floatData [dataCount];
  byte  rawData [dataCount * sizeof (float)];
  } myData;

unsigned long lastSerialPrint = 0;

void setup()
{
  Serial.begin(9600);
  Wire.begin();
}  // end of setup

void loop()
{
    if (Wire.requestFrom (slaveAddress, sizeof myData) == sizeof myData)
      {
      for (int i = 0; i < sizeof myData; i++)
         myData.rawData [i] = Wire.read ();
      }  // end if
         
    if(millis() - lastSerialPrint > 1000) //Like the Blink without delay example, true once a second
      {
      for (int i = 0; i < dataCount; i++)
        {
        Serial.print ("Float ");
        Serial.print (i);
        Serial.print (" Value: ");
        Serial.println (myData.floatData[i]);  
        } // end for
      lastSerialPrint = millis(); //Snapshot of when this happened, in milli seconds
      }  // end if
}  // ene of loop

Not tested, but it looks a lot shorter.