ADXRS450 Gyro not reading

Viewed 32

I have a roborio 1, with an ADXRS450 gyro plugged in to the SPI port. I have tried to access it with the following code:

...

private ADXRS450_Gyro compass = new ADXRS450_Gyro(SPI.Port.kOnboardCS0);

...

compass.calibrate();

...

if(compass.getAngle() < 180)
  m_robotDrive.arcadeDrive(0, 0.5);
else
  m_robotDrive.arcadeDrive(0, 0);

...

EOF

However, the gyro always reads 0. Is this a software or hardware error, and how can I fix it?

1 Answers
Related