Problems when running python code on raspberry pi 4b
January 11, 2024, 21:53
xzors3
I've been trying to connect a raspberry pi 4b to ads1115 for a few days now. I've never worked with this board before and I'm totally new to this. The wiring is correct from what I have seen on the internet, but when I download the library from the Adafruit ADS1X15 I get an error when running the code. I work with Python and operating system is Raspberry OS Lite. I have tested the board with Arduino and C++, it works without any problems. This is part of my thesis project and I would appreciate your help.
and what should i do with it cause i didn't understand 🥲
dutchslav
This
xzors3
i did it
xzors3
now i have (venv)
dutchslav
Now run the first command again
dutchslav
With the pip install
xzors3
its downloading somethingg
dutchslav
Good
xzors3
but why i have to use virtual enviro
dutchslav
Idk
dutchslav
The command said it
xzors3
I've seen it on the internet but it sounded hard for me
dutchslav
Does it work now?
xzors3
now i have another error
xzors3
dutchslav
pip install that module
xzors3
dutchslav
This again
xzors3
run this "pip install adafruit_ads1x15" again?
dutchslav
Yeah
xzors3
still the same
dutchslav
Lemme check rq
xzors3
okk
dutchslav
<@257436237466566656> you installed the library
dutchslav
And it says that library isn't found?
xzors3
yes
dutchslav
Then you should try opening a GitHub issue
dutchslav
Sorry that i can't help you
xzors3
its okay
xzors3
thanks a lot
xzors3
<@1063554880121348117>
xzors3
I fixed it
xzors3
Now it imports the library without problems
oops.se
Could you share the "fix"!
xzors3
If I'm honest with you, I have no idea how i solved it. I've read a lot of forums and saw that
sudo python3
and
python3
are somehow different commands. I know that sudo executes the command as root but this time was different. Also, i used venv.
xzors3
Then I had problem with i2c because the 0x48 is always in use. And i found out that if i disable i2c and then enable it, i can use this address for my ADS1115.
xzors3
Still looking for another solution but it works for now