qmi8658c
CircuitPython helper library for the QMI8658C 6-DoF Accelerometer and Gyroscope
Author(s): Taiki Komoda
Implementation Notes
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
- class qmi8658c.AccRange
Allowed values for
accelerometer_range.AccRange.RANGE_2_GAccRange.RANGE_4_GAccRange.RANGE_8_GAccRange.RANGE_16_G
- class qmi8658c.AccRate
Allowed values for
accelerometer_rate. Accelerometer low power(LP) mode must be a gyro disabled.AccRate.RATE_8000_HZAccRate.RATE_4000_HZAccRate.RATE_2000_HZAccRate.RATE_1000_HZAccRate.RATE_500_HZAccRate.RATE_250_HZAccRate.RATE_125_HZAccRate.RATE_62_HZAccRate.RATE_31_HZAccRate.RATE_LP_128_HZAccRate.RATE_LP_21_HZAccRate.RATE_LP_11_HZAccRate.RATE_LP_3_HZ
- class qmi8658c.GyroRange
Allowed values for
gyro_range.GyroRange.RANGE_16_DPSGyroRange.RANGE_32_DPSGyroRange.RANGE_64_DPSGyroRange.RANGE_128_DPSGyroRange.RANGE_256_DPSGyroRange.RANGE_512_DPSGyroRange.RANGE_1024_DPSGyroRange.RANGE_2048_DPS
- class qmi8658c.GyroRate
Allowed values for
gyro_rate.GyroRate.RATE_G_8000_HZGyroRate.RATE_G_4000_HZGyroRate.RATE_G_2000_HZGyroRate.RATE_G_1000_HZGyroRate.RATE_G_500_HZGyroRate.RATE_G_250_HZGyroRate.RATE_G_125_HZGyroRate.RATE_G_62_HZGyroRate.RATE_G_31_HZ
- class qmi8658c.QMI8658C(i2c_bus: I2C, address=107)
Driver for the QMI8658C 6-DoF accelerometer and gyroscope.
- Parameters:
Quickstart: Importing and using the device
Here is an example of using the
QMI8658Cclass. First you will need to import the libraries to use the sensorimport board import qmi8658c
Once this is done you can define your
board.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA sensor = qmi8658c.QMI8658C(i2c)
Now you have access to the
acceleration,gyroandtemperatureattributesacc_x, acc_y, acc_z = sensor.acceleration gyro_x, gyro_y, gyro_z = sensor.gyro temperature = sensor.temperature
- property accelerometer_range: int
The measurement range of all accelerometer axes. Must be a
AccRange