from machine import I2C, Pin
from time import sleep
from pico_I2c_lcd import I2cLcd
from dht import DHT22
i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=400000)
I2C_ADDR = i2c.scan()[0]
dht = DHT22(Pin(5))
lcd = I2cLcd(i2c, I2C_ADDR, 2, 16)
while True:
dht.measure()
temp = dht.temperature()
hum = dht.humidity()
lcd.clear()
lcd.print('Temp: ' + str(temp) + " C")
lcd.move_to(0,1)
lcd.print('Hum: ' + str(hum) + " %")
if temp and hum :
led_rojo.value(1) # Encender LED
sleep()
Agregar un LED y que este encienda cuando
la humedad y temperatura superen los 50°,
en pantalla igual debe mostrar
la temperatura y humedad