from machine import Pin
import dht
from time import sleep
ledr=Pin(21,Pin.OUT)
ledj=Pin(22,Pin.OUT)
cap=Pin(25,Pin.IN)
d=dht.DHT22(cap)
buzzer=Pin(23,Pin.OUT)
while True:
d.measure()
t=d.temperature()
h=d.humidity()
print("temperature=",t,"c","humidité=",h,"%")
if t>30:
buzzer.on()
ledr.on()
if h<80:
buzzer.on()
ledj.on()
sleep(10)