Testing the BNO085 SlimyVR IMU Sensor The photo illustrates the connection setup.
The sensor communicates with the Arduino Mega via the I2C bus. When you pick up the BNO085 and rotate it left and right, or tilt it sideways and forwards, you will observe a red box on the computer screen that mirrors these rotational movements. Ensure that the baud rate is consistent in both the Python script and the Arduino program. The current baud rate is set at 9600.
The Arduino program, utilizing the Adafruit_BNO08x library, sends data to the COM12 port as follows:
Serial started. Trying to initialize BNO08x. BNO08x Found! X: 0.02 Y: -0.57 Z: -90.12 X: 0.03 Y: -0.57 Z: -90.12 X: 0.03 Y: -0.58 Z: -90.12 X: 0.03 Y: -0.57 Z: -90.12 X: 0.03 Y: -0.57 Z: -90.12 X: 0.03 Y: -0.56 Z: -90.12 X: 0.03 Y: -0.56 Z: -90.11 X: 0.03 Y: -0.56 Z: -90.11 X: 0.03 Y: -0.55 Z: -90.11 ...
In this context, X, Y, and Z correspond to pitch, yaw, and roll respectively.
The Python program extracts this data and adjusts the pitch, yaw, and roll angles of the box accordingly:
cuboid.rotation_x = -z % 360 cuboid.rotation_y = -x % 360 cuboid.rotation_z = y % 360
Simultaneously, the program draws the coordinate system, marking the lines as follows: X = 1 line, Y = 2 lines, and Z = 3 lines.


