from machine import Pin
import dht
import time
# Define pins
dht_sensor = dht.DHT22(Pin(4))
LED = 8
led = Pin(LED, Pin.OUT)
while True:
dht_sensor.measure()
temperature = dht_sensor.temperature()
if temperature > 12:
print("patient has fever")
led.on()
else:
print("patient doesnot has fever")
led.off()
time.sleep(4)