I'm trying to read my DHT22 sensor (I think it's a DHT22) on my nodemcu ESP8266 board with micropython 1.13.
I use the following example code for DHT22:
Code: Select all
import dht
import machine
d = dht.DHT22(machine.Pin(4))
d.measure()
print(d.temperature()) # eg. 23.6 (°C)
print(d.humidity()) # eg. 41.3 (% RH)
However, when I use the DHT11 like this:
Code: Select all
d = dht.DHT11(machine.Pin(4))
Does this mean I'm probably working with a DHT11 sensor, or do I need to apply some more formatting on the DHT22 value received to make more sense of the output?
Thank you in advance!
Best regards,