#pressure-sensor #pressure #i2c

no-std xgzp6897d

i2c Driver for the XGZP6807D differential pressure sensor

1 unstable release

0.2.0 Sep 28, 2024
0.1.0 Sep 28, 2024

#1577 in Embedded development

MIT license

6KB
82 lines

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)

Dependencies

~56KB