fusion_hat.modules.adxl345 module

class fusion_hat.modules.adxl345.ADXL345(*args, address: int = 83, bus: int = 1, **kwargs)[source]

Bases: I2C

ADXL345 modules

X = 0

X

Y = 1

Y

Z = 2

Z

ADDR = 83
_REG_DATA_X = 50
_REG_DATA_Y = 52
_REG_DATA_Z = 54
_REG_POWER_CTL = 45
_AXISES = [50, 52, 54]
read(axis: int = None) float | List[float][source]

Read an axis from ADXL345

Parameters:

axis (int) – read value(g) of an axis, ADXL345.X, ADXL345.Y or ADXL345.Z, None for all axis

Returns:

value of the axis, or list of all axis

Return type:

float/list

_read(axis: int) float[source]