I don't have the wpilib source avaialble, so I can't check to see if this should make any difference at all, but is there a reason you're setting the sensitivity repeatedly (in teleop periodic)?
The following is essentially what we've done every year with the gyro:
Code:
import edu.wpi.first.wpilibj.Gyro;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
public class GyroscopeTesting extends IterativeRobot {
Gyro gyro;
public void robotInit() {
gyro = new Gyro(1);
gyro.setSensitivity(0.0070);
gyro.reset();
}
public void teleopInit() {
}
public void teleopPeriodic() {
double gyroAngle = gyro.getAngle();
SmartDashboard.putNumber("Gyro angle", gyroAngle);
System.out.println("Gyro Angle: " + gyroAngle);
}
}
If that doesn't work then I'd start looking at wiring, or where I think Joe was heading with the voltage check on the rate pin, the sensor itself. The only time I've had a problem with the sensor though is when it was run over by the robot, which has happened more than once.