I followed this tutorial to setup DHT22 thermal sensor on a raspberry pico: https://peppe8o.com/dht11-humidity-and-temperature-sensor-with-raspberry-pi-pico-and-micropython/?unapproved=7929&moderation-hash=06e75605461fa63372815fc1bebd285f#comment-7929 which uses this class to drive the sensor: https://raw.githubusercontent.com/ikornaselur/pico-libs/master/src/dht11/dht.py
But I'm getting the following error:
"Expected 84 but got 2 pulses"
which is defined in line 98 of the DHT class.
I'm running the sensor with the following code:
from machine import Pin
import utime as time
from DHT11 import DHT11, InvalidChecksum
dhtPIN = 15
dhtSensor = DHT11(Pin(dhtPIN, Pin.OUT, Pin.PULL_DOWN))
while True:
print("Temp: {}°C".format(dhtSensor.temperature), \
"| Hum: {0:.1%}".format(dhtSensor.humidity/100))
time.sleep(2.1)
One thing, the pins in my pico are not soldered, but even if I push the pico down the error keeps coming.