lh-dht22-rp

Crates.iolh-dht22-rp
lib.rslh-dht22-rp
version0.0.2
created_at2025-11-18 01:51:00.827182+00
updated_at2025-11-18 01:51:00.827182+00
descriptionDHT22 Humidity and Temperature Sensor Driver for RP2040
homepage
repositoryhttps://github.com/lhndo/lh-dht22-rp
max_upload_size
id1937788
size29,297
LH (lhndo)

documentation

README

DHT22 Humidity and Temperature Sensor Driver

For the RP2040 microcontroller

Based on rp2040_hal and embedded_hal.

Communicates though a single data wire which requires some internal pin handling for bi-directional state.

Reference: https://cdn-shop.adafruit.com/datasheets/Digital+humidity+and+temperature+sensor+AM2302.pdf

Example:


use lh_dht22_rp as dht22;
...
// Hal Boilerplate ...
...
let dht_pin = pins.gpio1;
let mut dht = dht22::DHT22::new(dht_pin, timer);

match dht.read() {
   Ok((humidity, temperature)) => {
         println!("Humidity   : {:.1} %RH", humidity);
         println!("Temperature: {:.1} C", temperature); },
   Err(e) => println!("Err: {e}"),
}
Commit count: 0

cargo fmt