Help with gyro in python (robot mesh)

I have a problem with the gyro not reading right or something, I have the values listed fine in my LCD screen, but when it comes ti auton, the values arnt reach and the robot spins forever. Please help.

while GyroBud.value() < 90:
FLdrive.spin(vex.DirectionType.FWD, 20, vex.VelocityUnits.PCT)
FRdrive.spin(vex.DirectionType.REV, 20, vex.VelocityUnits.PCT)
BLdrive.spin(vex.DirectionType.REV, 20, vex.VelocityUnits.PCT)
BRdrive.spin(vex.DirectionType.FWD, 20, vex.VelocityUnits.PCT)

I have tried putting the calibration part in preauto, auto and out of both, what do I do?

1 Like

It looks like you aren’t telling your robot to stop afterward. Add that code after the while loop.

1 Like

The code you’ve shared doesn’t look right. If we’re assume that FLdrive is the front left motor, BLdrive is the back left motor, FRdrive is the front right motor, and BRdrive is the back right motor, the code you’ve shared shouldn’t even make the robot turn. You are driving the right motors against each other and the left motors against each other. It’s impossible for us to know which way it’s turning, as it shouldn’t be turning if all the weight was balanced.

If the motor directions aren’t the problem, then you haven’t shared enough code to show the problem.

The easiest way to share code from a Robot Mesh Studio project is to set the project to public through the Options gear at the top right then provide a link to the project when asking for help. Often, the problem is not related to what the person asking for help thinks it is, and providing the entire project lets people see that.

1 Like