On the slave side, you need to place all the bytes to be sent in one buffer before sending it with Wire.write().
One way to do it is with a struct. Your receive sketch will work with this.
#include <Wire.h>
struct
{
float Voltage1;
float Voltage2;
float Voltage3;
float Current;
}
floatsToSend;
void requestEvent ()
{
floatsToSend.Voltage1 = 12.52;
floatsToSend.Voltage2 = 25.54;
floatsToSend.Voltage3 = 23.29;
floatsToSend.Current = 511.20;
Wire.write((byte*)&floatsToSend, sizeof(floatsToSend));
}
void setup() {
Wire.begin(8);
Wire.onRequest(requestEvent);
}
void loop() {}