40 lines
972 B
Markdown
40 lines
972 B
Markdown
# `adis1647x`
|
|
|
|
no_std driver for the Analog Devices [adis1647](https://www.mouser.com/new/analog-devices/adi-adis1647-imus/) family of IMUs. Currently only the adis16475 is supported
|
|
|
|
### Usage
|
|
|
|
You need an embedded_hal or embedded_hal_async spi driver and delay implementation
|
|
|
|
```toml
|
|
# async
|
|
adis1647x = { git = "https://git.ank.dev/ank/adis1647x", default-features = false, features = ["async"]
|
|
|
|
# sync
|
|
adis1647x = { git = "https://git.ank.dev/ank/adis1647x" }
|
|
|
|
```
|
|
|
|
```rust
|
|
use adis1647x::*;
|
|
use adis1647x::delta::*;
|
|
|
|
async fn main() -> Result<(), SomeSpiError> {
|
|
let bus = some_spi();
|
|
let delay = some_delay();
|
|
|
|
let imu = ADIS1647Async::new(bus, delay).await?;
|
|
|
|
let mut angle: DeltaAngle = Default::default();
|
|
|
|
loop {
|
|
data_ready_rising_edge().await;
|
|
|
|
let (delta_angle, _) = imu.deltas().await?;
|
|
|
|
angle += delta_angle;
|
|
|
|
println!("yaw: {} degrees", angle.angles().y);
|
|
}
|
|
}
|
|
```
|