Navx-mxp not giving gyro readings

We are new to using the navx-mxp (mounted on RoboRio and connected via USB) and are trying to get the gyro readings working. We got the DataMonitor example working in Java - https://pdocs.kauailabs.com/navx-mxp/examples/data-monitor/ (our code is exactly the same just copied and pasted Java example). All the readings are showing up fine except for the raw values - RawAccel_X, RawAccel_Y, RawAccel_Z, RawGyro_X, RawGyro_Y, RawGyro_Z, RawMag_X, RawMag_Y, RawMag_Z. All these values just show up as 0 and never change; we cannot figure out why this is happening.

We updated our RoboRio firmware today, but the problem persists.

Thanks for your help!

Let’s narrow things down a bit. The following indicators are helpful to help diagnose problems:

  • What value is being displayed on the dashboard for IMU_Connected?
  • Are there any error messages being logged to the Driver Station Console?
  • Can you confirm that you are using SPI to communicate with the board? This would mean your AHRS class constructor looks like this:
    ahrs = new AHRS(SPI::Port::kMXP);
  • Are the two green LEDs on the board (S1 and S2) solid on during your testing?

IMU_Connected is true
No error messages
We are using USB… my constructor is:
ahrs = new AHRS(SerialPort.Port.kUSB1);
yes, both green LEDs are solid

USB (and serial) only support either processed data or raw data, but not both simultaneously. https://pdocs.kauailabs.com/navx-mxp/guidance/selecting-an-interface/

Yup, I changed to SPI and it worked. Thank you!