xgzp6897d

Crates.ioxgzp6897d
lib.rsxgzp6897d
version0.2.0
sourcesrc
created_at2024-09-28 11:57:31.574024
updated_at2024-09-28 12:07:05.51803
descriptioni2c Driver for the XGZP6807D differential pressure sensor.
homepagehttps://github.com/nikitaignatov/xgzp6897d-rs
repositoryhttps://github.com/nikitaignatov/xgzp6897d-rs
max_upload_size
id1390069
size7,658
Nikita Ignatov (nikitaignatov)

documentation

README

XGZP6897D - differential pressure driver

A rust device driver for the XGZP6897D differential pressure sensor.

Datasheet | Product page | Dimensions

Usage

let mut device = XGZP6897D::new(i2c, xgzp6897d::DEVICE_ADDRESS, 4096f32);
loop {
    match device.read_sensor() {
        Ok((pressure, temperature)) => {
            log::info!(
                "Pressure: {:.3} Pa; Temperature: {:.2} °C", 
                pressure, 
                temperature
            );
        }
        Err(_) => log::error!("Failed to read XGZP6897D!"),
    }

    FreeRtos.delay_ms(1000);
}

License

Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)

Commit count: 5

cargo fmt