Skip to content

DHT11 SENSOR

Jaume Olivé Petrus edited this page Aug 25, 2017 · 38 revisions

Specification

What Comments
Identifier DHT11
Interface GPIO 1 pin
Provides temperature celsius degrees
humidity % relative humidity
Properties none
Datasheet

Code

-- Attach DHT11 to  GPIO26
s = sensor.attach("DHT11", pio.GPIO26)

while true do
  print("temp: "..s:read("temperature")..", hum: "..s:read("humidity"))
  tmr.delayms(500)
end
Clone this wiki locally