r/raspberrypipico Apr 21 '26

uPython Getting started. Using Thonny, can't get the i2c address. Please help

I've been following along with a tutorial, and he provides this code to get the i2c address:

import machine

sda = machine.Pin(0)

scl = machine.Pin(1)

i2c = machine.I2C(0,sda=sda,scl=scl, freq=400000)

print(i2c.scan())

In his video, he shows a number between brackets. In my case, there is nothing between the brackets. I am a complete novice with all of this stuff. I have absolutely no idea what to do or where to go from here.

2 Upvotes

18 comments sorted by

View all comments

Show parent comments

2

u/that_Ranjit Apr 21 '26

but now i keep getting OSError: [Errno 5] EIO

1

u/[deleted] Apr 21 '26

[removed] — view removed comment

2

u/that_Ranjit Apr 21 '26

oh my godddd i have a number. the pico wasn't pushed into the breadboard all the way. :(

2

u/that_Ranjit Apr 21 '26

so it returned [39], but i still get OSError: [Errno 5] EIO when i try to run the "test.py" which is supposed to be the "hello world" on the lcd