Hello I am currently creating a project for a college class, long story short, I am trying to configure an Arduino Uno to use an MPU6050 in order to control servo motors based on the orientation of the gyroscope. I am not great at coding so I have mostly reserved to looking for similar codes online making some changes to fit my project.
The problem I am facing is the fact that I will need to attach the MPU upside down, and I am struggling to figure out how exactly how to configure my code for my MPU to be oriented upside down. Based on those readings the servo motors will move accordingly. in order to account for any tilting of the gyroscope in order to keep it parallel to the ground.
I attached the code that I have found and been using, aside for minor alternations to the code in order to fit my project, I have not changed anything so it works more or less fine when MPU is upright.
I have attempted to research in the offset of the gyroscope as I believed that to be the key to my problem however with no luck. The lines of the offset in the code are:
mpu.setXGyroOffset(37);
mpu.setYGyroOffset(-11);
mpu.setZGyroOffset(-2);
mpu.setZAccelOffset(1688); // 1688 factory default for my test chip
Any help will be greatly appreciated, Thank You.
PS. There is another problem with the code I am facing however my current concern is to orient the MPU to read the coordinates upside down.
WorkingControls.ino (5.27 KB)