As @neurofun notes - the number ref names were not correct. But seeing this:
the first byte is 65024 (decimal) and the second is 13671(decimal).
But if the power goes over 1000W.. say 2034.2W the first byte is 65280 and the second is 20342
Implied your 'byte' is a 16 bit word of two bytes - or it could not hold those values.
And if the source of these 4 bytes - in two 16 bit parts is a common float representation just divided for transmission, then the union might allow them to be re-assembled.
Working backward SerMon shows this to see what p#2 suggested, which does not match post #1, so those don't appear to be 'float' halves.
Code:
xx.b.one46531
xx.b.two17160
yy.b.one18022
yy.b.two17662
Updated for two of the values in p#4:
if the load is 46.61W i get 65024 in the first int and 4616 in the second
if the load is 1938.2W I get 65280 in the first int and 19382 in the second
It like this::
Code:
typedef union
{
struct
{
uint16_t one;
uint16_t two;
} b;
float f;
} aFloat_Type;
void loop3() {
aFloat_Type xx;
xx.f = 1938.2;
aFloat_Type yy;
yy.f = 46.61;
Serial.print( "xx.f" );
Serial.println( xx.f );
Serial.print( "xx.b.one" );
Serial.println( xx.b.one );
Serial.print( "xx.b.two" );
Serial.println( xx.b.two );
Serial.print( "yy.f" );
Serial.println( yy.f );
Serial.print( "yy.b.one" );
Serial.println( yy.b.one );
Serial.print( "yy.b.two" );
Serial.println( yy.b.two );
}
Shows this - pardon the spacing:
Code:
xx.f1938.20
xx.b.one18022
xx.b.two17650
yy.f46.61
yy.b.one28836
yy.b.two16954