adafruit_icm20x

Library for the ST ICM20X Motion Sensor Family

  • Author(s): Bryan Siepert

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_icm20x.AccelDLPFFreq

Options for accel_dlpf_cutoff

class adafruit_icm20x.AccelRange

Options for accelerometer_range

class adafruit_icm20x.CV

struct helper

classmethod add_values(value_tuples)

Add CV values to the class

classmethod is_valid(value)

Validate that a given value is a member

class adafruit_icm20x.GyroDLPFFreq

Options for gyro_dlpf_cutoff

class adafruit_icm20x.GyroRange

Options for gyro_data_range

class adafruit_icm20x.ICM20649(i2c_bus, address=104)

Library for the ST ICM-20649 Wide-Range 6-DoF Accelerometer and Gyro.

Parameters:
  • i2c_bus (I2C) – The I2C bus the ICM20649 is connected to.
  • address – The I2C slave address of the sensor
class adafruit_icm20x.ICM20948(i2c_bus, address=105)

Library for the ST ICM-20948 Wide-Range 6-DoF Accelerometer and Gyro.

Parameters:
  • i2c_bus (I2C) – The I2C bus the ICM20948 is connected to.
  • address – The I2C slave address of the sensor
magnetic

The current magnetic field strengths onthe X, Y, and Z axes in uT (micro-teslas)

magnetometer_data_rate

The rate at which the magenetometer takes measurements to update its output registers

class adafruit_icm20x.ICM20X(i2c_bus, address)

Library for the ST ICM-20X Wide-Range 6-DoF Accelerometer and Gyro Family

Parameters:
  • i2c_bus (I2C) – The I2C bus the ICM20X is connected to.
  • address – The I2C slave address of the sensor
accel_dlpf_cutoff

The cutoff frequency for the accelerometer’s digital low pass filter. Signals above the given frequency will be filtered out. Must be an AccelDLPFCutoff. Use AccelDLPFCutoff.DISABLED to disable the filter

Note readings immediately following setting a cutoff frequency will be inaccurate due to the filter “warming up”

acceleration

The x, y, z acceleration values returned in a 3-tuple and are in m / s ^ 2.

accelerometer_data_rate

The rate at which accelerometer measurements are taken in Hz

Note: The data rates are set indirectly by setting a rate divisor according to the following formula: accelerometer_data_rate = 1125/(1+divisor)

This function does the math to find the divisor from a given rate but it will not be exactly as specified.

accelerometer_data_rate_divisor

The divisor for the rate at which accelerometer measurements are taken in Hz

Note: The data rates are set indirectly by setting a rate divisor according to the following formula: accelerometer_data_rate = 1125/(1+divisor)

This function sets the raw rate divisor.

accelerometer_range

Adjusts the range of values that the sensor can measure, from +/- 4G to +/-30G Note that larger ranges will be less accurate. Must be an AccelRange

gyro

The x, y, z angular velocity values returned in a 3-tuple and are in degrees / second

gyro_data_rate

The rate at which gyro measurements are taken in Hz

Note: The data rates are set indirectly by setting a rate divisor according to the following formula: gyro_data_rate = 1100/(1+divisor) This function does the math to find the divisor from a given rate but it will not be exactly as specified.

gyro_data_rate_divisor

The divisor for the rate at which gyro measurements are taken in Hz

Note: The data rates are set indirectly by setting a rate divisor according to the following formula: gyro_data_rate = 1100/(1+divisor)

This function sets the raw rate divisor.

gyro_dlpf_cutoff

The cutoff frequency for the gyro’s digital low pass filter. Signals above the given frequency will be filtered out. Must be a GyroDLPFFreq. Use GyroDLPFCutoff.DISABLED to disable the filter

Note readings immediately following setting a cutoff frequency will be inaccurate due to the filter “warming up”

gyro_range

Adjusts the range of values that the sensor can measure, from 500 Degrees/second to 4000 degrees/s. Note that larger ranges will be less accurate. Must be a GyroRange

initialize()

Configure the sensors with the default settings. For use after calling reset()

reset()

Resets the internal registers and restores the default settings

class adafruit_icm20x.MagDataRate

Options for magnetometer_data_rate