# Arduino Nano 33 IoT Basic LSM6DS3 Yaw Pitch & Roll on p5js via BLE \[working\]

**URL:** <https://discourse.processing.org/t/arduino-nano-33-iot-basic-lsm6ds3-yaw-pitch-roll-on-p5js-via-ble-working/43125>\
**Category:** Libraries\
**Created:** [November 2, 2023, 4:44pm UTC](https://discourse.processing.org/t/arduino-nano-33-iot-basic-lsm6ds3-yaw-pitch-roll-on-p5js-via-ble-working/43125 "2023-11-02T16:44:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgomba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/dgomba/32/18976_2.png) [@dgomba](https://discourse.processing.org/u/dgomba)\
**Post date:** [November 2, 2023, 4:44pm UTC](https://discourse.processing.org/t/arduino-nano-33-iot-basic-lsm6ds3-yaw-pitch-roll-on-p5js-via-ble-working/43125/1 "2023-11-02T16:44:45Z")

</div>

Hi!  
I’m trying to create a basic cube visualisation of the LSM6DS3 on the Arduino 33 IoT in p5js using ble.js-

But I have to say the data I receive is totally random.

This is the Arduino code

> <https://gist.github.com/vongomben/13bbb4d6919bf6a55ff40fbc70ede173>

This is the P5js

> **[p5.js Web Editor](https://editor.p5js.org/vongomben/sketches/-2xj3pGf7)**
>
> A web editor for p5.js, a JavaScript library with the goal of making coding accessible to artists, designers, educators, and beginners.

I excluded all the readings, in order to have just one, but the readings on the p5 side are super noisy

![ble](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/6/f/6f33cae9611a65d1fad0ce8d19811c81f9492c52.gif)

Will come back on this tomorrow morning, hope to find some help.

---

<div class="post-metadata">

**Author:** ![dgomba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/dgomba/32/18976_2.png) [@dgomba](https://discourse.processing.org/u/dgomba)\
**Post date:** [November 5, 2023, 9:42am UTC](https://discourse.processing.org/t/arduino-nano-33-iot-basic-lsm6ds3-yaw-pitch-roll-on-p5js-via-ble-working/43125/2 "2023-11-05T09:42:27Z")

</div>

Hi!  
I solved the issue (and several other after).  
The main problem in that moment was that the float was read as two numbers (I think)

What I did is pass everything (yaw roll and pitch) in an array.

Here is a working pair of codes, passing the IMU service.

[IMU BLE Arduino Nano 33 IoT example](https://gist.github.com/vongomben/1bb6bd4b5ae6227a78d9dff49fa2f1c2)

[BLE IMU Receiver Example](https://editor.p5js.org/vongomben/sketches/e-N5ybvyh)

Enjoy!
