from machine import Pin ,ADC
from utime import sleep
import neopixel
from dht import DHT22
import dht
import math
def convert(x, in_min, in_max, out_min, out_max):
return (x - in_min) * (out_max - out_min) // (in_max - in_min) + out_min
a=0.5
b=0.2
def feel_like(T,H,W):
return (T+a*(1-H/100)-b*math.sqrt(W))
senz=DHT22(Pin(5))
pot25=ADC(Pin(25,Pin.IN))
while True:
w=convert(pot25.read(),0,4095,0,100)
senz.measure()
T=senz.temperature()
H=senz.humidity()
print(f"Feel_like: {feel_like(w,T,H)}")