DHT22 Sensor Driver
A platform-agnostic driver for the DHT22 (AM2302) temperature and humidity sensor using [embedded-hal] traits.
Designed for use in no_std embedded environments.
Features
- Supports blocking reads from the DHT22 sensor.
- Compatible with any platform that implements [
embedded-hal] traits. no_stdsupport.- Tested using
embedded-hal-mock.
Usage
Add this to your Cargo.toml:
[]
# dht22-sensor = "0.1"
= { = "https://github.com/implferris/dht22-sensor" }
Example
use Dht22;
use ;
use DelayNs;
// `pin` must support switching between input/output modes.
// `delay` should implement DelayNs for microsecond delays.
let mut dht = new;
match dht.read
License
MIT