lis2hh – accelerometer device driver

LIS2HH Driver - i2c Accelerometer

class lis2hh.LIS2HH(addr=30, int1_pin=<sphinx.ext.autodoc.importer._MockObject object>)[source]

Device driver for LIS2HH accelerometer, controlled via i2c bus.

ctrl(reg, cmd)[source]

Set control registers

dump_axes()[source]

Debug - send axis values to stdout

enable_int1(threshold=20, duration=5, cb=None)[source]

Enable inertial interrupt on all axes. Threshold is upper byte of 16-bit value, 0 disables.

read()[source]

Read current XYZ axis values and update ‘axis_*’ values

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

sleep()[source]

Shutdown operation - draws about 5uA

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

wake()[source]

Recover from sleep