Telegram Group & Telegram Channel
اسکریپت 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



tg-me.com/micropython_iot/28
Create:
Last 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

BY Micropython & IOT


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/micropython_iot/28

View MORE
Open in Telegram


Micropython & IOT Telegram | DID YOU KNOW?

Date: |

If riding a bucking bronco is your idea of fun, you’re going to love what the stock market has in store. Consider this past week’s ride a preview.The week’s action didn’t look like much, if you didn’t know better. The Dow Jones Industrial Average rose 213.12 points or 0.6%, while the S&P 500 advanced 0.5%, and the Nasdaq Composite ended little changed.

Micropython & IOT from ru


Telegram Micropython & IOT
FROM USA