How to use mpu6050 vertically?

i am using an esp32 xiao board with an mpu6050 and due to size constraints i have placed the mpu such that the x arrow is downwards and y arrow faces forward i want to know the direction the controller is looking at when using roll it doesnt work quite well it only works when the sensor is horizontal

You will need to create a translate function that takes the current readings and passes them to functions that apply the changes you have instigated by the vertical mounting. For instance, the Z values will be the new X values if I understand your description.

The axes are independent sensors with very similar responses.

Either change the axis names to match the program, or rewrite the program to match the orientation.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.