from machine import Pin
from time import sleep
import dht
Ledr=Pin(21,Pin.OUT)
Ledb=Pin(22,Pin.OUT)
ledv=Pin(25,Pin.OUT)
cap=Pin(26,Pin.IN)
d=dht.DHT22(cap)
while True:
    d.measure()
    t=d.temperature()
    print("temperature=",t,"C")
    if t < 14:
        Ledr.on()
    elif 14 <=t <20:
        ledb.on()
    else:
        ledv.on()
    sleep(5)