Expand description
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 special pin handling for bi-directional communication.
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}"),
}Structs§
Enums§
Traits§
- Reconstruct
Pin - Trait for constructing a dynamic input or output pin from scratch