from machine import Pin, ADC
from time import sleep
from dht import DHT22
dht=DHT22(Pin(14))
led=Pin(16,Pin.OUT)
while True:
dht.measure()
temp = dht.temperature()
hum = dht.humidity()
print(f"Temperature: {temp}°C Humidity: {hum}% ")
if temp<=40:
led.off()
else:
led.on()