VEX IQ Gyro drive straight with gear ratio of 5:2 help!

We are trying to get our robot to drive 44 inches forward using gyro keeping the heading at 0 degrees. We are following a teacher workshop code that went off Caution Tape’s PStraight code video.

Please help me figure out if my calculations are way off base.
our code

Since we have a 5:2 gear ratio and our code is set up to turns (rotations)
wheels are 200mm

2.2 rotations should = 8 inches x 2.5 driven gear = 44 inches

But the robot never stops.

The code looks fine, my guess would be either you need to divide by 2.5 or it’s driving the wrong way and is actually getting further from the target instead of closer to it. Try switching the “spin DT reverse” blocks to “spin DT forward.” If you still want it to go the same direction try reversing the motors in the configuration screen or using a negative speed and a negative distance instead.

1 Like