When I installed the V5 inertial sensor onto the robot, it was working fine. But after taking in 2 mobile goals, then rerunning the autonomous program, the inertial sensor fails to find the 40 deg heading.
I went into the devices menu and tested the inertial sensor, and when I turned the robot 90 degrees, the sensor showed me it only detected 15-30 degrees.
I used Drivetrain.setHeading(0,degrees) in the code to calibrate the sensor
I used Drivetrain.turnToHeading(40,degrees) in the code to turn