TG Telegram Group & Channel
Micropython & IOT | United States America (US)
Create: Update:

اسکریپت Lua برای DHT11

pin = 1

status, temp, humi, temp_dec, humi_dec = dht.read(pin)--read dht11 from pin

if status == dht.OK then —check status is ok and print temperature and humidity

print(string.format("DHT Temperature:%d.%03d;Humidity:%d.%03d",
math.floor(temp),
temp_dec,
math.floor(humi),
humi_dec
))

elseif status == dht.ERROR_CHECKSUM then —else print either status

print( "DHT Checksum error." )
elseif status ==
dht.ERROR_TIMEOUT then
print( "DHT timed out." )
end

🆔 @micropython_iot

اسکریپت Lua برای DHT11

pin = 1

status, temp, humi, temp_dec, humi_dec = dht.read(pin)--read dht11 from pin

if status == dht.OK then —check status is ok and print temperature and humidity

print(string.format("DHT Temperature:%d.%03d;Humidity:%d.%03d",
math.floor(temp),
temp_dec,
math.floor(humi),
humi_dec
))

elseif status == dht.ERROR_CHECKSUM then —else print either status

print( "DHT Checksum error." )
elseif status ==
dht.ERROR_TIMEOUT then
print( "DHT timed out." )
end

🆔 @micropython_iot


>>Click here to continue<<

Micropython & IOT




Share with your best friend
VIEW MORE

United States America Popular Telegram Group (US)