Arduino Serial Write Float

'Printing' floating point numbers over the serial stream My thanks to 'mem' at the Arduino forum for the following code, and for permission to post it here. He did say it was put together quickly, so do please get in touch (with me) if you discover any 'features' which need attention!

There is not such fuction. But, when doing Arduino to Arduino communication, you'd better using directly raw bytes instead of HEX. Vso convertxtodvd 4 serial yahoo. This is some example code: Write float over serial: byte * f_p = (byte *) &float_var; Serial. Write(f_ p[0]); Serial.

Write(f_ p[1]); Serial. Write(f_ p[2]); Serial. Write(f_ p[3]); Read back from serial: float float_var; byte * f_p = (byte *) &float_var; f_p[0] = Serial.read(); f_p[1] = Serial.read(); f_p[2] = Serial.read(); f_p[3] = Serial.read(); Not tested, but should give you the idea.