import machine import Pin, I2C
import SSD1306
from time import sleep_msfrom servo import Servo
import dht
ledr = Pin(5, Pin.OUT)
ledv = Pin(9, PIN.OUT)
servo = Servo(Pin(17))
servo1 = Servo(Pin(12))
capteur = dht.DHT22(Pin(0))
i2c = I2C(0, scl = Pin(21), sda = Pin(28))
oled = ssd1306.SSD1306_I2C(128, 64, i2c)
while True:
capteur.measure()
temperature = capteur.temperature()
humidite = capteur.humidity()
sleep(2)
print("Température: {:.1f}°C".format(temperature))
print("humidité: {:.1f}%".format(humidite))
if 5 <= temperature <= 20 and humidite == 100:
ledr