import dht
from machine import Pin
from time import sleep
sensor=dht.DHT22(Pin(16))
blue=Pin(9,Pin.OUT)
pink=Pin(8,Pin.OUT)
yellow=Pin(7,Pin.OUT)
while True:
sensor.measure()
temp=sensor.temperature()
print("Temperature:",temp,"c")
if temp<25:
yellow.on()
blue.off()
pink.off()
print("the temperature is cool")
elif temp>=25 and temp<=50:
pink.on()
blue.off()
yellow.off()
print("the temperature is warm")
else:
blue.on()
pink.off()
yellow.off()
print("the temperature is sever hot")
sleep(2)