DHT22 SENSOR - chowette/Lua-RTOS-ESP32 GitHub Wiki
Specification
| What | Comments | |
|---|---|---|
| Identifier | DHT22 | ![]() |
| Interface | GPIO | 1 pin |
| Provides | temperature | celsius degrees |
| humidity | % relative humidity | |
| Properties | none | |
| Datasheet |
Code
-- Attach DHT22 to GPIO26
s = sensor.attach("DHT22", pio.GPIO26)
while true do
print("temp: "..s:read("temperature")..", hum: "..s:read("humidity"))
tmr.delayms(500)
end
