Generic Rust accelerometer support, including traits and types for taking readings from 2 or 3-axis accelerometers
Find a file
Paul Sajna beebf00c77
Correct Z orientation
Gravity is a downward (negative) force so faceup is negative Z
2020-03-11 12:55:20 -07:00
.github/workflows Switch to GitHub Actions (actions-rs) 2019-11-13 08:55:26 -08:00
img v0.9.0 2019-11-14 06:52:06 -08:00
src Correct Z orientation 2020-03-11 12:55:20 -07:00
.gitignore Cargo.lock: Add to .gitignore and remove checked-in copy 2019-03-24 09:01:22 -07:00
Cargo.toml v0.11.0 2020-01-23 08:32:10 -08:00
CHANGES.md v0.11.0 2020-01-23 08:32:10 -08:00
CODE_OF_CONDUCT.md Initial implementation 2019-03-24 08:02:04 -07:00
LICENSE-APACHE Initial implementation 2019-03-24 08:02:04 -07:00
LICENSE-MIT Initial implementation 2019-03-24 08:02:04 -07:00
README.md README.md: Add adxl355 crate 2020-01-25 07:27:09 -08:00

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

  • Rust 1.31+

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 Name Description Crate + Docs
ADXL343 Analog Devices 3-axis accelerometer crates.io docs.rs
ADXL355 Analog Devices 3-axis accelerometer crates.io docs.rs
LIS2DH12 ST 3-Axis MEMS Accelerometer crates.io docs.rs
LIS3DH High Performance ST 3-Axis MEMS "nano" Accelerometer crates.io docs.rs
MMA7660FC Grove 3-Axis Digital Accelerometer crates.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: