mpu6000

Crates.iompu6000
lib.rsmpu6000
version0.3.0
sourcesrc
created_at2020-05-03 03:53:03.131947
updated_at2022-05-22 05:59:03.135652
descriptionPlatform agnostic driver for MPU6000 6-axis IMU
homepage
repositoryhttps://github.com/qiuchengxuan/mpu6000
max_upload_size
id236887
size23,741
qiuchengxuan (qiuchengxuan)

documentation

README

MPU6000

DATASHEET | REGISTER MAP

Example

use embedded_hal::blocking::delay::DelayMs;
use mpu6000::{Bus, DelayMs, MPU6000};
use mpu6000::registers::{AccelerometerSensitive, GyroSensitive};
...
// create SPI that implemented embedded_hal::blocking::spi::Write + Transfer
// create OutputPin as Chip Select that impelmented embedded_hal::digital::v2::OutputPin
// create Delay that implemented embedded_hal::blocking::delay::DelayMs
...
let mut spi_bus: SpiBus<SPI, OutputPin> = SpiBus::new(spi, output_pin);
let mpu6000 = MPU6000::new(&mut spi_bus);
mpu6000.reset(&delay)?;
mpu6000.wake(&delay)?;
mpu6000.set_accelerometer_sensitive(accelerometer_sensitive!(+/-16g, 2048/LSB))?;
mpu6000.set_gyro_sensitive(gyro_sensitive!(+/-2000dps, 16.4LSB/dps))?;
Commit count: 18

cargo fmt