Hi there,
Im looking for some help concerning the above title. I received the kit for Christmas and have been doing my best to follow the relevant tutorials/wikis but I have encountered several problems I would love some support with to figure out where I am going wrong.
I am trying to run the script dht20_tem_hum.py from the beginner guide. I have installed the correct libraries (lcd1602 and dht20) when I run the script I’m constantly face with an issue on line 7 “Traceback (most recent call last):
File “”, line 7, in
TypeError: function takes 2 positional arguments but 3 were given”
Please can someone help me understand what the issue is? Below is the script used.
from lcd1602 import LCD1602
from dht20 import DHT20
from machine import I2C,Pin,ADC
from utime import sleep
i2c0 = I2C(0,scl=Pin(9), sda=Pin(8)) #dht20
i2c1 = I2C(1,scl=Pin(7), sda=Pin(6), freq=400000) #LCD
dht20 = DHT20(0x38,i2c0)
d = LCD1602(i2c1, 2, 16)
d.display()
while True:
temper = dht20.dht20_temperature()
humidity = dht20.dht20_humidity()
sleep(1)
d.clear()
d.setCursor(0,0)
d.print(“Temp:”+ str(temper))
d.setCursor(0,1)
d.print(“Humid:”+ str(humidity))
sleep(1)
FYI When removing the address from line 7 (0x38) to remove the third argument I’m presented with another error which I’m stuck with. Please see below error.
“Traceback (most recent call last):
File “”, line 7, in
File “dht20.py”, line 6, in init
File “dht20.py”, line 25, in dht20_read_status
OSError: [Errno 5] EIO”