How do you make a gyro sensor work in an autonomous program?

Hi! Our team has been trying to exact our autonomous program by adding a gyro sensor, but we’ve been having some difficulties.

how many difficulties do you have and how big are they?

Are you using a drivetrain in your code by chance? When I used a gyro drivetrain to get my robot to turn for a specific amount of degrees, it would just sit there and spin infinitely. I ended up programming my own function to turn using the gyro. If you can describe the issues that you are having and post your code, I may be able to help you further.

One thing that really helps in programming with the gyro is to have the brain display the current gyro reading on the display. That way, as you are testing the robot throughout the routine, you can see where the gyro is numerically (going positive, going negative) and adjust your programs accordingly. Most common mistake is to be turning negative and have > instead of < in the logic.

1 Like