| Crates.io | lh-dht22-rp |
| lib.rs | lh-dht22-rp |
| version | 0.0.2 |
| created_at | 2025-11-18 01:51:00.827182+00 |
| updated_at | 2025-11-18 01:51:00.827182+00 |
| description | DHT22 Humidity and Temperature Sensor Driver for RP2040 |
| homepage | |
| repository | https://github.com/lhndo/lh-dht22-rp |
| max_upload_size | |
| id | 1937788 |
| size | 29,297 |
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
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}"),
}