/** * Author: giltesa * WebSite: http://giltesa.com * License: CC BY-NC-SA 3.0 */ struct Sensores{ float temperatura; float humedad; int luz; }; union Datos{ Sensores dato; byte b[sizeof(Sensores)]; } origen, destino; void setup() { Serial.begin(9600); delay(1000); origen.dato.temperatura = -103.38; origen.dato.humedad = 84.06; origen.dato.luz = 124; Serial.print("OrigenT= "); Serial.print(origen.dato.temperatura); Serial.print("\nOrigenH= "); Serial.print(origen.dato.humedad); Serial.print("\nOrigenL= "); Serial.print(origen.dato.luz); for(int i=0 ; i < sizeof(origen.dato) ; i++) destino.b[i] = origen.b[i]; Serial.print("\n\nDestinoT= "); Serial.print(destino.dato.temperatura); Serial.print("\nDestinoH= "); Serial.print(destino.dato.humedad); Serial.print("\nDestinoL= "); Serial.print(destino.dato.luz); } void loop() { }