Connect OLED(SSD1306)

October 20, 2023, 08:16

m240024

Hello There! I Want To Connect Raspbarry Pi Pico To OLED(SSD1306), But I Have A Problem. I Used This https://www.hackster.io/diyprojectslab/how-to-use-an-oled-display-with-raspberry-pi-pico-d9d9cb BreadBoard Setup And Codes But When I Run The "main.py" code, VS Code Terminal Show Me This Error : File "<stdin>", line 6, in <module> File "ssd1306.py", line 110, in __init__ File "ssd1306.py", line 36, in __init__ File "ssd1306.py", line 71, in init_display File "ssd1306.py", line 115, in write_cmd OSError: [Errno 5] EIO And My main.py And ssd1306.py code is in the site i said on up here. Please Help Me!:rpi:

oops.se

So it fails on File "<stdin>", line 6, in <module>, what do that line say ? A hint, have you downloaded the library for the OLED?

m240024

i downloaded ssd1306 library

m240024

using this codes : pip install adafruit-blinka | pip install adafruit-circuitpython-ssd1306

m240024

and this is the line 6 of this code: oled = SSD1306_I2C(WIDTH,HEIGHT,i2c)

oops.se

I don't know how you get the library onto the Pico with VScode. But from the error message it look like it's missing

oops.se

I uses thonny

m240024

i in the vs code termin/powershell typed this two codes : pip install adafruit-blinka | pip install adafruit-circuitpython-ssd1306

m240024

that you mean i type codes in terminal/micropython

m240024

but it doesnt work

m240024

and in the thonny

m240024

i try to download packages but it say : 404 not found

m240024

you knwo how i can get ssd1306 for thony?

m240024

<@796000224690307072>

oops.se

Well we have been here before and I say the same thing. 404 = It doesn't exists!

m240024

but

m240024

i can get it on thonny manually?

m240024

and

m240024

why the ssd1306 are dosent exits?

m240024

<@796000224690307072>

oops.se


oops.se

Click on the blue ssd1306 and pick install

oops.se


oops.se

And now it should work

m240024


m240024


m240024

<@796000224690307072>

m240024

See

m240024

<:sadblob:1021204158587600916> 😔

m240024

Whyyyyyy

oops.se

Have you updated your Thonny to latest version?

m240024

and i think this are the latest version

oops.se

Well then I can't help you

m240024

Or you can send ssd1306 libs , and i install it manually?

oops.se

And since you click the 3 dots and NOT install then it will fail

oops.se

I click install and that works, if I click the 3 dots I get a 404

oops.se

So click INSTALL!

m240024

You know how can hard reset micropython device

m240024

?

m240024

<@796000224690307072>

m240024

How can i hard reset?

oops.se

And this is your last warning about cross posting!

m240024

Ok

k9t33n

ok so <@867329008911908914>

k9t33n

have you found it?

k9t33n

teh website

m240024

<@1071178789939331253>

m240024

That's it!

m240024

Eh?!

m240024

Where are you

k9t33n

I can't read that launguage

k9t33n

it's not in English

m240024

in chrome

m240024

You can click on three dots

m240024

And use tranlate

m240024

<@1071178789939331253>

k9t33n

I can't find any information

k9t33n

I don't know what to do for you

m240024

Idk

k9t33n

ok great

k9t33n

just try that then

m240024

Say

k9t33n

so just put
py
import ssd1306
at the start of your script instead of the other 3

m240024

No thats ok

m240024

I mean

m240024

Ssd1306 package

m240024

File "<stdin>", line 6, in <module> File "ssd1306.py", line 110, in __init__ File "ssd1306.py", line 36, in __init__ File "ssd1306.py", line 71, in init_display File "ssd1306.py", line 115, in write_cmd OSError: [Errno 5] EIO

m240024

When i run the code

m240024

I will get this errors

m240024

<@1071178789939331253>

m240024

And i tryed lot of codes

k9t33n

this isn't a complete error I don't think

k9t33n

and this doesn't work?
py
from machine import Pin, I2C
from ssd1306 import SSD1306_I2C
WIDTH =128 
HEIGHT= 64
i2c=I2C(0,scl=Pin(1),sda=Pin(0),freq=200000)
oled = SSD1306_I2C(WIDTH,HEIGHT,i2c)
while True:
    oled.fill(0)
    oled.text("DIY PROJECTS LAB", 0, 0)
    oled.text("Tutorial", 0, 40)
    oled.show()

m240024

I can't believe it's working!

m240024

thanks you su much

k9t33n

your welcome

k9t33n

it's fine