#arduino #esp32 #sensor #humidity-sensor

no-std dht20

platform agnostic driver for dht20 temperature and humidity sensor

1 unstable release

0.1.0 Sep 21, 2023

#27 in #arduino

MIT/Apache

7KB
75 lines

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:?}");
    }
}

Dependencies

~160KB