kxtj3 – accelerometer device driver

class CB3.kxtj3.KXTJ3(i2c, address=14)[source]

Device driver for KXTJ3 accelerometer, controlled via i2c bus.

dump_axes()[source]

Debug - send axis values to stdout

read()[source]

Read current XYZ axis values and update ‘self.orientation’ tuple

Returns

tuple of (x, y, z) axis values.

  • Default full-scale range is ±2g.

  • Values are signed 16-bit integer (-32767 to +32768)

reset()[source]

Reset the accelerometer to expected configuration.

self_test()[source]

Run self-test. Return True if passed

verify_id()[source]

Verify the part id. Return True if passed.