Hello Chief Delphi,
I am attempting to implement the ADXRS450 gyroscope (http://firstchoicebyandymark.com/fc16-000) that was included in the kit of parts this year with Java, but running into the following problem:
ERROR 1 could not find ADXRS450 gyro on SPI port 0 org.usfirst.frc.team1188.robot.Robot.robotInit(Robot.java:10)
I have looked at this CD thread and this FRC Reddit post, as well as several other CD threads relating to this chip and the Analog Devices FRC page, but nothing has helped me.
Here is code from my Robot.java file. I was trying to just isolate the gyro, and have no logic in any of the other methods (teleop periodic, etc.)
import edu.wpi.first.wpilibj.ADXRS450_Gyro;
import edu.wpi.first.wpilibj.IterativeRobot;
public class Robot extends IterativeRobot {
ADXRS450_Gyro gyro;
public void robotInit() {
gyro = new ADXRS450_Gyro(); // This is the line specified in the error message.
}
}
I get a very similar error when trying to use the chip’s ADXL362 accelerometer, though it specifies SPI port 1 instead of port 0. I’m hoping the solution to this problem solves that as well, but it’s secondary because I can always use the built in accelerometer.
I have tried using the other constructor specified in the wpilib, that requests an SPI port. I have tried both ports 0 and 1; same error for each (but the SPI port in the messages changes as expected.)
I have NOT tried this chip on any other RoboRIO, or any other chip with this code. I have also not tried any other device in this RoboRIO’s SPI port, so I can’t rule out hardware as a problem. But, I also don’t know of a good way to test that quickly.
Has anyone gotten this device to work in Java? The internet seems to have very little information on it in an FRC-context, but with every team getting one this year I’m hoping someone can help.
Please let me know if I need to provide any additional details. Thank you in advance!