2c. Gyroscope - Amarygdala/FRC-5911 GitHub Wiki

Exercise proper precautions when handling sensitive electronics!

Overview

The gyroscope measures the angle and orientation of the robot. This is useful for driving straight and specific angle turns in teleop and autonomous.

What you need

  • Gryoscope (should be already attached to the RoboRIO)

Code

side note for gyro

you may see that there are a bunch of stuff with the gyro in the Bravo1 code where the drive code is like this

 drive.tankDrive(stick1.getY(Hand.kLeft)+ 1.0 * error/30, stick1.getY(Hand.kLeft)- 1.0 * error/30);

this just makes it so that the robot moves straight when A button is held down. You may find that the robot has trouble moving straight if you already drove it.

side note

Resources