lis2dh – accelerometer device driver

LIS2HH Driver - i2c Accelerometer

class codex.lis2dh.LIS2DH(i2c, addr=25)[source]

Device driver for LIS2DH accelerometer, controlled via i2c bus.

dump_axes()[source]

Debug - send axis values to stdout

read()[source]

Read current XYZ axis values and update orientation

reset()[source]

Init registers to default config

self_test()[source]

Run self-test and return device to default state. Return True if passed

set_byte(reg, val)[source]

Set byte register

static test_exceeds(a, b, delta)[source]

Test each iterable value: a[0..n] - b[0..n] > delta

verify_id()[source]

Verify device ID - return True if correct

wait_xyz_ready()[source]

Poll status register and return True when READY, False if timeout

Download Source