Crates.io | lsm6ds3tr |
lib.rs | lsm6ds3tr |
version | 0.1.1 |
source | src |
created_at | 2023-01-26 13:44:12.662818 |
updated_at | 2023-06-22 13:58:38.74619 |
description | LSM6DS3TR 6-axis (DOF) IMU accelerometer & gyroscope rust driver library |
homepage | |
repository | https://gitlab.com/mtczekajlo/lsm6ds3tr-rs |
max_upload_size | |
id | 768529 |
size | 4,883,514 |
LSM6DS3TR-C 6-axis (DOF) IMU accelerometer & gyroscope rust driver library.
Inspired by LSM9DS1 rust driver.
use lsm6ds3tr::{interface::SpiInterface, AccelScale, LsmSettings, LSM6DS3TR};
//...
let spi_interface = SpiInterface::new(spi, spi_cs);
let mut imu = LSM6DS3TR::new(spi_interface).with_settings(LsmSettings::basic());
imu.init().expect("LSM6DS3TR-C initialization failure!");
if let (Ok(xyz_a), Ok(xyz_g)) = (imu.read_accel(), imu.read_gyro()) {
dbg!(xyz_a, xyz_g);
}
See my LightCube project for application usages.