1
Fork 0
adis1647x/readme.md
2025-03-15 14:33:08 -04:00

972 B

adis1647x

no_std driver for the Analog Devices adis1647 family of IMUs. Currently only the adis16475 is supported

Usage

You need an embedded_hal or embedded_hal_async spi driver and delay implementation

# async
adis1647x = { git = "https://git.ank.dev/ank/adis1647x", default-features = false, features = ["async"]

# sync
adis1647x = { git = "https://git.ank.dev/ank/adis1647x" }

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);
    }
}