Coder Social home page Coder Social logo

avsa242 / lsm6dsl-spin Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 286 KB

Parallax P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the ST LSM6DSL 6DoF IMU

License: MIT License

Propeller Spin 95.39% Makefile 4.61%
sensor imu accelerometer gyroscope 6dof i2c spi spin propeller lsm6dsl

lsm6dsl-spin's Introduction

lsm6dsl-spin


This is a P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the ST LSM6DSL 6DoF IMU.

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

  • SPI connection at 4MHz (P1), up to 10MHz (P2)
  • Set accelerometer and gyroscope full-scale, data rate
  • Read accelerometer raw data, or scaled to micro-G's (live or from FIFO)
  • Read gyroscope raw data, or scaled to micro-dps (live or from FIFO)
  • Data ready flags
  • Manually or automatically set accel/gyro bias offsets (accel: on-chip, gyro: in MCU RAM)
  • Soft-reset
  • Gyroscope sleep mode
  • Set gyroscope low-pass filter
  • Set INT1 interrupt mask
  • Click/tap-detection (single): set threshold, time, latency, per-axis detection
  • Free-fall detection: set threshold, time
  • Auto-sleep/wake/(in)activity detection
  • FIFO functionality: empty, full, overrun, watermark flags, unread sample count, set decimation of data entries to FIFO, set mode, set data rate, set watermark level
  • Pedometer (step counter) embedded functionality support

Requirements

P1/SPIN1:

  • spin-standard-library
  • 1 extra core/cog for the PASM I2C engine
  • sensor.accel.common.spinh (provided by spin-standard-library)
  • sensor.gyroscope.common.spinh (provided by spin-standard-library)

P2/SPIN2:

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

Compiler Compatibility

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

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

Limitations

  • Click detection currently only supports single-click

Known issues

  • When gyro_scale() is set to 2000dps, it is technically possible (though unlikely in practice) for the measurements returned by gyro_dps() to overflow 32-bit signed integer max - this isn't protected against

lsm6dsl-spin's People

Contributors

avsa242 avatar

Watchers

 avatar  avatar  avatar

lsm6dsl-spin's Issues

Add FIFO support

The chip has a FIFO memory that isn't yet implemented - currently the methods are only defined as placeholders, with no actual code.

Calibration results poor

Gyro results seem to vary wildly, and are several whole degrees off 0.
The accelerometer Z-axis isn't horrible, but could be better.
Both processors P1, P2, and both interfaces I2C, SPI seem equally affected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.