IMU Sensors on GoPiGo2

I am trying to use the Dexter Industries IMU Sensor on a GoPiGo2 using the I2C port in Python, but I can’t find any sample code anywhere.

This is surprising, given that the description on the Web page states “The IMU (Inertial Measurement Unit) Sensor can be mounted to Dexter Industries robots like the GoPiGo, GrovePi, and BrickPi . It detects motion, orientation, and position of your robot.”

The only Python code I can find references using the sensor with the GoPiGo3 through the AD1 port. Here is an excerpt from the sample code, IMUSensor.py:

from di_sensors.inertial_measurement_unit import InertialMeasurementUnit

print(“Example program for reading a Dexter Industries IMU Sensor on a GoPiGo3 AD1 port.”)

imu = InertialMeasurementUnit(bus = “GPG3_AD1”)

After a little research I found the problem myself. It was necessary to simply change the port setting from this:

imu = InertialMeasurementUnit(bus = “GPG3_AD1”)

to this:

imu = InertialMeasurementUnit(bus = “RPI_1”)

Hi @michael_bush,

I think you are looking for this part right here:
https://di-sensors.readthedocs.io/en/master/structure.html#hardware-interface-section

Thanks!