Crates.io | xgzp6897d |
lib.rs | xgzp6897d |
version | 0.2.0 |
source | src |
created_at | 2024-09-28 11:57:31.574024 |
updated_at | 2024-09-28 12:07:05.51803 |
description | i2c Driver for the XGZP6807D differential pressure sensor. |
homepage | https://github.com/nikitaignatov/xgzp6897d-rs |
repository | https://github.com/nikitaignatov/xgzp6897d-rs |
max_upload_size | |
id | 1390069 |
size | 7,658 |
A rust device driver for the XGZP6897D differential pressure sensor.
Datasheet | Product page | Dimensions
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);
}
Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)