import dht
from machine import Pin
import time
import neopixel
NUM_LEDS = 16
np = neopixel.NeoPixel(Pin(14), NUM_LEDS)
sensor = dht.DHT22(Pin(4))
def spremeniBarvo(barvo):
for i in range(NUM_LEDS):
np[i] = barvo
np.write()
while True:
sensor.measure()
temp = sensor.temperature()
#print("VLAG: ", sensor.humidity())
if temp < 0:
spremeniBarvo([0, 0, 255])
if temp > 0 and temp < 20:
spremeniBarvo([0, 255, 0])
if temp > 30:
spremeniBarvo([255, 0 , 0])
#time.sleep(1)