from machine import Pin
from time import sleep
from dht import DHT22
sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
dhtPin = Pin(16)
dht22 = Pin(dhtPin, Pin.IN, Pin.PULL_UP)
dht22 = DHT22(dht22)
print("DHT22 temperatuur en vochtigheid")
while True:
dht22.measure()
sleep(1)
temp22 = round(dht22.temperature(),1)
hum22 = round(dht22.humidity(),1)
print("\r",temp22, hum22, end="")