bma423¶
BMA423 Bosch Accelerometer CircuitPython Driver included in the Lilygo Watch V3
Author(s): Jose D. Montoya
-
class bma423.BMA423(i2c_bus: busio.I2C, address: int =
0x19)[source]¶ Driver for the BMA400 Sensor connected over I2C.
- Parameters:¶
- Raises:¶
RuntimeError – if the sensor is not found
Quickstart: Importing and using the device
Here is an example of using the
BMA423class. First you will need to import the libraries to use the sensorimport board import bma423Once this is done you can define your
board.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA bma = bma423.BMA423(i2c)Now you have access to the attributes
accx, accy, accz = bma.acceleration- property acc_range : str¶
Sensor acc_range
Mode
Value
bma423.ACC_RANGE_20x00bma423.ACC_RANGE_40x01bma423.ACC_RANGE_80x02bma423.ACC_RANGE_160x03
- property filter_performance : str¶
Sensor filter_performance
Mode
Value
bma423.CIC_AVG0x00bma423.CONT0x01
- property output_data_rate : str¶
Sensor output_data_rate
Mode
Value
bma423.BANDWIDTH_25_320b0001bma423.BANDWIDTH_25_160b0010bma423.BANDWIDTH_25_80b0011bma423.BANDWIDTH_25_40b0100bma423.BANDWIDTH_25_20b0101bma423.BANDWIDTH_250b0110bma423.BANDWIDTH_500b0111bma423.BANDWIDTH_1000b1000bma423.BANDWIDTH_2000b1001bma423.BANDWIDTH_4000b1010bma423.BANDWIDTH_8000b1011bma423.BANDWIDTH_16000b1100
- property oversample_rate : str¶
Sensor oversample_rate. Bandwidth parameter, determines filter configuration (acc_perf_mode=1) and averaging for undersampling mode (acc_perf_mode=0)
Mode
Value
bma423.OSR10x00bma423.OSR20x01bma423.OSR40x02bma423.OSR80x03bma423.OSR160x04bma423.OSR320x05bma423.OSR640x06bma423.OSR1280x07