I'm trying to read data from an Arduino UNO and send them via Serial to a ESP8266 in order to transmit them to my pc in real time.
/*EACH FLOAT*/
byte byteFloat[sizeof(float)];
//memcpy(byteFloat,(unsigned char*) Serial.read(), sizeof(float));*/
data = Serial.readBytes(byteFloat,sizeof(float));
/*4 BYTES FOR EACH FLOAT*/
for(j=0;j<4;j++){
client.print(byteFloat[j]);
}
client.print("-");
The result is always 4 byte set as 0 , read via PuTTY it returns a wall of '0000-'
How can I make it work?
thx