I want to use a mpu6050 gyro and accelerometer module to read the angle the module is at and based on that angle, increase or decrease motor speed. I have modified the code from a self-balancing drone video which used PID. I attempted to remove the PID because it is unnecessary for my purpose of just reading the angle and changing motor speed while keeping the portions measuring angles. Then I added a simple if-then statement saying if the axis angle is within 0-45 degrees, set the motor speed to that (that anglex37) because the top motor speed is 2000 and it is not safe to go past 85% motor power in fear of damaging the vesc. I truly don't know how high of a speed I can code my motor to but I will adjust accordingly because I don't know if the Arduino motor speed is just rpms.
Anyways here is the drone code:Drone code
Here is my code:My Code