Home

Awesome

<img src="https://raw.githubusercontent.com/NeoBirth/accelerometer.rs/develop/img/cartesian-ferris.png" width="150" height="110">

accelerometer.rs

Crate Docs Build Status Safety Dance MSRV LGPL 3.0 licensed Gitter Chat

Generic Rust accelerometer support, including traits and types for taking readings from 2 or 3-axis accelerometers, intended for use with platform-agnostic accelerometer drivers written using embedded-hal.

Uses no_std-oriented 2D and 3D vector types from the micromath.rs crate.

Additionally includes support for tracking device orientations using accelerometer data.

Documentation

Requirements

Supported Crates

The following dependent crates providing platform-agnostic accelerometer drivers built on embedded-hal which also implement the Accelerometer and/or the RawAccelerometer traits from this crate:

Device NameDescriptionCrate + Docs
ADXL313Analog Devices 3-axis accelerometercrates.io docs.rs
ADXL343Analog Devices 3-axis accelerometercrates.io docs.rs
ADXL355Analog Devices 3-axis accelerometercrates.io docs.rs
LIS2DH12ST 3-Axis MEMS Accelerometercrates.io docs.rs
LIS3DHHigh Performance ST 3-Axis MEMS "nano" Accelerometercrates.io docs.rs
MMA7660FCGrove 3-Axis Digital Accelerometercrates.io docs.rs
STK8BA58SENSORTEK 3-Axis MEMS Accelerometercrates.io docs.rs
KXTJ31057Silicon Micromachined 3-axis accelerometercrates.io docs.rs

Orientation Tracking (3-axis accelerometers only)

ezgif-1-16e98d9b86ad

One of the main features of this crate is device orientation tracking for 3-axis accelerometers, which is gated under the orientation cargo feature (enabled-by-default). This provides smartphone-like device position sensing using an accelerometer alone, returned as one of the variants of the accelerometer::Orientation enum.

See the accelerometer::Tracker documentation for more information.

Code of Conduct

We abide by the Contributor Covenant and ask that you do as well.

For more information, please see CODE_OF_CONDUCT.md.

License

Copyright © 2019-2020 NeoBirth Developers

Dual licensed under your choice of either of: