# Reading byte array into float (expanding on SerialCallResponse example)

**URL:** <https://discourse.processing.org/t/reading-byte-array-into-float-expanding-on-serialcallresponse-example/16880>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [January 5, 2020, 7:09pm UTC](https://discourse.processing.org/t/reading-byte-array-into-float-expanding-on-serialcallresponse-example/16880 "2020-01-05T19:09:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [January 5, 2020, 8:24pm UTC](https://discourse.processing.org/t/reading-byte-array-into-float-expanding-on-serialcallresponse-example/16880/2 "2020-01-05T20:24:02Z")

</div>

> [@julianop](#):
>
> , but how do I read four bytes from Processing’s receive buffer into a `float`?

- [Transmission of a float through a serial link - Processing 2.x and 3.x Forum](http://Forum.Processing.org/two/discussion/12757/transmission-of-a-float-through-a-serial-link#Item_4)

> [@Float value to Byte array](https://discourse.processing.org/t/float-value-to-byte-array/16698/3):
>
> This is my take on it for both opposite conversion ways. left_right_arrow You can also take a look at this site below in order to double-check results: heavy_check_mark[H-Schmidt.net/FloatConverter/IEEE754.html](http://H-Schmidt.net/FloatConverter/IEEE754.html)[Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Float.html#floatToIntBits(float)](http://Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Float.html#floatToIntBits(float)) /\*\* \* Float As Bytes Array (v1.1.1) \* GoToLoop (2019/Dec/29) \* https://Discourse.Processing.org/t/float-value-to-byte-array/16698/3 \*/ static final float MY\_FLOAT = -PI; byte[] fl…

---

_[View the full topic](https://discourse.processing.org/t/reading-byte-array-into-float-expanding-on-serialcallresponse-example/16880)._
