Skip to content

Parallax P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the ST LIS3DH 3DoF Accelerometer

License

Notifications You must be signed in to change notification settings

avsa242/lis3dh-spin

Repository files navigation

lis3dh-spin


This is a P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the ST LIS3DH 3DoF accelerometer

IMPORTANT: This software is meant to be used with the spin-standard-library (P8X32A) or p2-spin-standard-library (P2X8C4M64P). Please install the applicable library first before attempting to use this code, otherwise you will be missing several files required to build the project.

Salient Features

  • I2C connection at up to 400kHz (P1, P2)
  • SPI connection (3w, 4w) at ~4MHz (P1), up to 5MHz (P2)
  • Read raw or scaled accelerometer data output
  • Set output data rate
  • Set full-scale range
  • Enable per-axis output
  • Flags to indicate data is ready, or has overrun
  • Set calibration offsets
  • FIFO control and flag reading (empty, full, number of unread samples)
  • Set interrupt sources by mask, set threshold level, read interrupt flags
  • Single and double-click detection
  • Free-fall detection

Requirements

P1/SPIN1:

  • spin-standard-library
  • 1 extra core/cog for the PASM I2C or SPI engine (none, if bytecode engine is used)
  • sensor.accel.common.spinh (provided by spin-standard-library)

P2/SPIN2:

  • p2-spin-standard-library
  • sensor.accel.common.spin2h (provided by p2-spin-standard-library)

Compiler Compatibility

Processor Language Compiler Backend Status
P1 SPIN1 FlexSpin (6.9.4) Bytecode OK
P1 SPIN1 FlexSpin (6.9.4) Native/PASM OK
P2 SPIN2 FlexSpin (6.9.4) NuCode Some runtime issues
P2 SPIN2 FlexSpin (6.9.4) Native/PASM2 OK

(other versions or toolchains not listed are not supported, and may or may not work)

Limitations

  • TBD

About

Parallax P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the ST LIS3DH 3DoF Accelerometer

Topics

Resources

License

Stars

Watchers

Forks