Este shield le permitirá medir temperatura y humedad a la vez en el sistema WeMos D1 Mini WiFi. Con este shield podrá realizar mediciones de temperatura y humedad precisas y enviarlas via Wifi a una aplicación online o pagina web.
Características
- Temperatura: -40~80°C (±0.5°C)
- Humedad: 0-99.9%RH (±2%RH)
Pines
D1 mini | Shield |
D4 | Data out |
Codigo de ejemplo para NodeMCU
pin = 4
status, temp, humi, temp_dec, humi_dec = dht.read(pin)
if status == dht.OK then
-- Integer firmware using this example
print(string.format("DHT Temperature:%d.%03d;Humidity:%d.%03d\r\n",
math.floor(temp),
temp_dec,
math.floor(humi),
humi_dec
))
-- Float firmware using this example
print("DHT Temperature:"..temp..";".."Humidity:"..humi)
elseif status == dht.ERROR_CHECKSUM then
print( "DHT Checksum error." )
elseif status == dht.ERROR_TIMEOUT then
print( "DHT timed out." )
end
Todavía no hay comentarios.