How jonathan-z-code/dht11_sensor works
This is a small Arduino library for reading a DHT11 temperature and humidity sensor. The main workflow is: a caller requests data, the library resets and starts the sensor transaction, Arduino interrupt handling captures timed signal edges, and the parser checks the acknowledgement and checksum before returning a result. The example sketch is present in the tree, but its source was not sampled, so its usage details are not represented.
Main entry points: DHT11_Sensor.cpp Transaction control · DHT11_Sensor.h DHT11 API
Components 6
Other components
- Library caller
- DHT11 sensor
- DHT11 API
src/DHT11_Sensor.h - Transaction control
src/DHT11_Sensor.cpp - Edge parser
src/DHT11_Sensor.cpp - Arduino runtime
Connections 11
- Library caller → DHT11 API: requests data
- DHT11 API → Transaction control: calls getData
- Transaction control → Transaction control: resets state
- Transaction control → Arduino runtime: controls GPIO
- Transaction control → DHT11 sensor: starts reading
- Transaction control → Arduino runtime: attaches interrupt
- Arduino runtime → Edge parser: dispatches IRQ
- Edge parser → Arduino runtime: reads timestamps
- Edge parser → Edge parser: parses and validates
- Transaction control → Edge parser: checks status
- Transaction control → Library caller: returns result