Giter Club home page Giter Club logo

mpu9250's Introduction

mpu9250

no_std driver for the MPU9250 (and some MPU* devices) & onboard AK8963 (accelerometer + gyroscope + magnetometer IMU).

Build Status

What works

  • Reading the accelerometer, gyroscope, temperature sensor, and magnetrometer: both raw and scaled and converted values.
  • Setting DLPF, reading scales, sample rate divisor.
  • Reading the WHO_AM_I registers of mpu9250 and ak8963.
  • Getting resolutions and factory sensitivities.

Supported chips

  • MPU9250 -- Imu and Marg;
  • MPU9255 -- Imu and Marg;
  • MPU6500 -- Imu only.

Notes

MPU9255 has some extra capability in the ASIC that allows some additional gesture control but otherwise this chip is identical to the MPU9250.

Basic usage

Include library as a dependency in your Cargo.toml crates.io:

[dependencies.mpu9250]
version = "<version>"

Use embedded-hal implementation to get SPI, NCS, and delay, then create mpu handle:

extern crate mpu9250; // or just use mpu9250; if 2018 edition is used.

// to create sensor with mag support and default configuration:
let mut _imu = Mpu9250::marg_default(spi, ncs, &mut delay)?;
// to create sensor without mag support and default configuration:
let mut marg = Mpu9250::imu_default(spi, ncs, &mut delay)?;
// to get all supported measurements:
let all = marg.all()?;
println!("{:?}", all);

More examples

Number of examples can be found in proving-ground repo. Examples include: reading temperature, calibrating magnetrometer, reading all sensors.

Experimental I2C support

Expiremntal I2C support is enabled via i2c feature flag. When enabled, SPI support will be deactivated and type of mpu9250 driver will change from Mpu9250<SpiDevice<SPI, NCS>, MODE> will change to Mpu9250<I2cDevice<I2C>, Imu>.

The MPU9250 currently supports an IMU-only configuration. See the BeagleBone Blue example for a demonstration. Support for the AK8963 is a WPI.

Documentation

API Docs available on docs.rs.

License

Licensed under either of

at your option.

Testimonials

Started off as a fork of japaric's mpu9250 repo.

mpu9250's People

Contributors

bofh avatar bors[bot] avatar homunkulus avatar japaric avatar little-arhat avatar lolzballs avatar mariusknaust avatar mciantyre avatar tchamelot avatar vickenty avatar

Watchers

 avatar

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.