dht20 0.1.0

platform agnostic driver for dht20 temperature and humidity sensor
Documentation
  • Coverage
  • 0%
    0 out of 10 items documented0 out of 5 items with examples
  • Size
  • Source code size: 17.53 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.21 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • MnlPhlp/dht20
    1 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MnlPhlp

dht20

Rust driver for dht20 temp/hum sensor. Works on all platforms that implement embedded_hal.

Usage

let mut sensor = Dht20::new(
    i2c/*platform specific i2c driver*/,
    0x38,
    esp_idf_hal::delay::Delay/*platform specific delay*/,
);
match sensor.read() {
    Ok(reading) => println!("Temp: {} °C, Hum: {} %",reading.temp, reading.hum),
    Err(e) => {
        error!("Error reading sensor: {e:?}");
    }
}