Тёмный

Raspberry Pi Pico W LESSON 25: Getting Started with OLED 1306 in Micropython 

Paul McWhorter
Подписаться 379 тыс.
Просмотров 9 тыс.
50% 1

This is the OLED display we will be using in future lessons. Please go ahead and order it so you will have it for next week's lesson:
amzn.to/3nq8l4Z
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
/ paulmcwhorter
In this class we will be using the Sunfounder Raspberry Pi Pico W Keppler Kit. It will make things a lot easier if we are working on identical hardware. the link below is to amazon, and is for the identical hardware I will be using in this entire class.
amzn.to/3ubMRs1
In this introductory video, I will show you how to use the 1306 OLED display with the Raspberry Pi Pico W. We will show you step-by-step how to use this display. We will implement the project using micropython. Enjoy!
[Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. ]
#raspberrypipicoW
#oled
#micropython

Наука

Опубликовано:

 

5 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 98   
@jbelmont72
@jbelmont72 7 месяцев назад
For those of you running into error messages. the below may help. I solved this error message by running the I2C scanner, found my OLED is on 0x3d. I didn't know how to specify the address which I guess in the example finds it by default. What worked for me is: oled = SSD1306_I2C(128,64,i2c,addr = 0x3d) I hope this spares others the pain I had. I thank you all for your help. Much appreciated. This is the error I was getting. Searching the internet, I see others had the same problems and all the posts I read just ended without satisfactory resolution. MPY: soft reboot Traceback (most recent call last): File "", line 24, in File "/lib/ssd1306.py", line 110, in __init__ File "/lib/ssd1306.py", line 36, in __init__ File "/lib/ssd1306.py", line 71, in init_display File "/lib/ssd1306.py", line 115, in write_cmd OSError: [Errno 5] EIO
@RCWalletVacuum
@RCWalletVacuum 4 месяца назад
Thanks for posting this very helpful solution!
@edSabio572
@edSabio572 18 дней назад
Hi Paul! Just revisiting your lesson for lesson 78. The second time around found things missed the first time...Thanks Again!
@shadowbrookmedia
@shadowbrookmedia Год назад
Hi Paul, just quick note of thanks and encouragement. I am a retired EE trying to learn a few new tricks. I don;t normally like video tutorials - not how I learned for many years. Too many host with heavy British or Packi accents. I'm from the deep south and basically speak the King's English (the King is Elvis) We speak very slowly down here and most people don't know, we listen very slowly as well. As I age my hearing is flattening out making some dialogues difficult to follow. Yours is spot on for me!! A year or so or go I had two massive strokes. (according to brain scans - I had no idea) No motive issues - all damage inside my head - the attention span dropped dramatically and memory issues surfaced. Was writing Python code for medical products -but had to quit - added too much stress to trying to work and keep a schedule. Now that I'm coming back with the Arduino things are clearing up and making sense again. Your patient approach is very helpful. Keep it up and thanks again
@svsv9
@svsv9 Месяц назад
Hope Ant had had a sip of ice coffee too.. This video helped me a lot. spend a day testing other samples could not make it work till this lesson. Thanks.
@WACkZerden
@WACkZerden Год назад
bravo Great Lesson. Thank You for taking the time to show the basic functions of the display/library.
@paulmcwhorter
@paulmcwhorter Год назад
Glad it was helpful!
@Ed-fv9rl
@Ed-fv9rl Год назад
Thanks Paul! This was my longest lesson but most productive. Had to download the ssd1306 directly, without the tools menu and used pin 0 and 1 to make it work. Still here.
@rickbonari4493
@rickbonari4493 Год назад
I am legend. Figured out how to do this and like you I love these little displays. They have alot of capabilities to enhance projects and are fun to experiment with to boot. I don't post anything to youtube but I can assure you I was able to do this. Had to do some research. Thanks for a great series on pico w. No one on the internet can match your knowledge and teaching capabilites and explain things in a clear and concise way like you do !!!! Thanks again. You are the very BEST !!!!!
@paulmcwhorter
@paulmcwhorter Год назад
LEGEND!
@stephenlightkep1621
@stephenlightkep1621 Год назад
Thanks Paul! That was really cool.
@paulmcwhorter
@paulmcwhorter Год назад
Glad you liked it!
@jorgenonell1108
@jorgenonell1108 11 месяцев назад
great video Paul!
@Bob-zg2zf
@Bob-zg2zf Год назад
So beautiful. The scenery. I mean The River Nile.
@cbrombaugh
@cbrombaugh Год назад
I AM LEGEND! I like the SSD1306 display. When I received mine I studied enough to learn its basic operation. My 50 pixel circle is missing a top and bottom, but my 25 pixel version fits the screen fine (although somewhat oval). Thanks Paul for showing us how to use this little display.
@paulmcwhorter
@paulmcwhorter Год назад
LEGEND!
@masman1st
@masman1st 2 дня назад
Been doing these with the Pico W Sunfounder kit. "They are great by the way!" Recently purchased some ESP32 wroom dev boards, so thought I would give them a try. They are not as ready to go as the Pico W out of the box. But after a little research I was able to do this on the ESP32 in Thonny with the same script for the Pico W. Gitty Up!
@louistoweill4232
@louistoweill4232 3 месяца назад
I replaced the OLED display with a new one and the circuit worked this time.
@videonewschannel1212
@videonewschannel1212 3 месяца назад
Here is a solution to the non-working OLED issue many have been experiencing. After finding out that my uctronics OLED display works fine on the Arduino platform and is not discoverable (I2c.scan() returns null) on the pico w platform, I thought perhaps it is a voltage issue since Arduino runs 5V and pico 3.3V. Problem solved by powering your OLED Vcc with 5V from any 5V source (eg. arduino board or breadboard power supply). Just remember to tie the grounds together (Pico w and other source). This also allows you to use any of the I2C channels (0,1) ... Bottom line its either a hardware issue specific to the UCtronics OLED which is sold on Amazon or the pico 3.3V is not quite 3.3V. The UCtronics OLED device documentation states it works 3.3 to 5V but apparently not. Thanks Paul for your suggestion of I2C.scan()
@freddyveza
@freddyveza Год назад
Hello Paul! I have a couple of lcd displays lying around, could they work for this future lesson or should I get an oled screen instead?
@paulmcwhorter
@paulmcwhorter Год назад
I would really suggest get the OLED. It has major advantages over the LCD and is only about $5
@freddyveza
@freddyveza Год назад
@@paulmcwhorter Thanks, I'll get one
@larryplatzek9017
@larryplatzek9017 8 месяцев назад
Loading ssd1306 does not work for me 12-07-23. Things must have changed, can anyone tell me the correct way to install? Thank you!
@todd3c
@todd3c 5 месяцев назад
I just copied it and saved it as ssd1306.py
@user-gj5fe3dn7j
@user-gj5fe3dn7j 4 месяца назад
I got the same problem. not being able to download ssd1306. did you find any solution?
@freddyveza
@freddyveza Год назад
Looks like I messed up during my bought and got an SH1106 1.3" screen, gotta make it work with a different driver, cause my SSD1306 is really small, just 0.69"...
@MartinAlix
@MartinAlix 10 месяцев назад
Great lesson! What happened to that ant? 😂
@diggee172
@diggee172 9 месяцев назад
😅
@user-gj5fe3dn7j
@user-gj5fe3dn7j 4 месяца назад
Traceback (most recent call last): File "", line 1, in ImportError: no module named 'ssd1306'
@wizardbynight
@wizardbynight 28 дней назад
shout-out to the breadboard ant at 17:13
@todd3c
@todd3c 5 месяцев назад
I have 2 dds1306(s). how do I change the address of the 2nd one so I can define both and have 2 different displays going? thank you.
@drdentin3215
@drdentin3215 Год назад
Hey Paul. A very off topic question. You appear to live in a dark sky area. Do you check out the stars, milky way, planets,nebula?
@paulmcwhorter
@paulmcwhorter Год назад
I had a telescope as a kid, but it never turned into a passion for me. So no, no atronomy going on here.
@louistoweill4232
@louistoweill4232 3 месяца назад
Even though I think I followed all the steps exactly, my OLED display does not work and I do not know how to run the I2C scanner if that might help.
@chikhimngi
@chikhimngi Год назад
hello Paul. Do you have any courses about Django?
@ctlancearrowlarson8237
@ctlancearrowlarson8237 Год назад
When I go to the package manager, and search ssd1306, I get this message. Could not find the package info from PyPl. Error code:
@paulmcwhorter
@paulmcwhorter Год назад
Your computer appears to be objecting to the security certificate of micropython. Find the library on github, ssd1306.py. Copy it and paste it into thonny. Then save the file to ssd1306.py on your pico. It should then be there for you to use.
@user-gj5fe3dn7j
@user-gj5fe3dn7j 4 месяца назад
"ImportError: no module named 'ssd1306'" does show up after copy and pasting it into thonny.
@user-gj5fe3dn7j
@user-gj5fe3dn7j 4 месяца назад
installing it come up with version 0.1.0 version only and error while loading it!
@keithlohmeyer
@keithlohmeyer Год назад
Here is my deep dive into ways to plot a circle. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-3VroWb0Zr3g.html I show 6 different algorithms and time each to see which is fastest.
@paulmcwhorter
@paulmcwhorter Год назад
Very interesting. Lots of ways to skin this cat.
@davidh1187
@davidh1187 4 месяца назад
My OLED does not work with channel 1 Pins 2 and 3 (throws lots of ssd1306.py errors) but it does work channel 1 pins 6 and 7 as well as channel 0 pins 0 and 1
@user-gj5fe3dn7j
@user-gj5fe3dn7j 4 месяца назад
ssd1306 does not work by following your instructions, any help?
@robertbowman6599
@robertbowman6599 4 месяца назад
The installation failed in Thonny. I prefer VS Code. I created a venv in my work directory python3.10 -m venv pico_code cd pico_code . bin/activate python3.10 -m pip install pipkin then with neither thonny or code connected pipkin install micropython-ssd1306. pipkin detects the Pico board and installs /lib/ssd1306.py connect with VS Code and run the example. it may have been my wiring but I wound up using I2C0 sda/scl on physical pins 1 and 2 so I have i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=400000) The rest is the same. I don't know why the install from Thonny failed There were a lot of cryptic errors. I had also downloaded ssd1306.py and copied that to the Pico. I think at that time I had a wiring problem since it failed in write_cmd() It took a lot longer than it should have but I did learn about pipkin which seems to be a relatively easy way to install libraries without thonny.
@keithlohmeyer
@keithlohmeyer Год назад
Looks like I am 3rd to post a video showing the the built in method. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mg9fBHhFQmw.html Charlotte and Lori got the jump on me as I was doing a deep dive into ways to code a raster circle. That video will post shortly. Thanks Paul for all you do.
@pralaymajumdar1206
@pralaymajumdar1206 5 месяцев назад
Just one symbol I want to share with you sir that is❤..
@AviSchwartz1
@AviSchwartz1 2 месяца назад
For me channel 1 gives an [Errno 5] EIO error while channel 0 works fine.
@paulmcwhorter
@paulmcwhorter 2 месяца назад
Dont understand why, but seems some OLED only work on channel 0 for me. Not sure what is going on.
@deeperlook3234
@deeperlook3234 11 месяцев назад
Kudos for the comprehensible explanation! But did you realize you had a bug? 😁 You can clearly see it escaping from the display to the right at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-6SdNvqofWww.html
@paulmcwhorter
@paulmcwhorter 11 месяцев назад
Great video. Thanks.
@user-gj5fe3dn7j
@user-gj5fe3dn7j 4 месяца назад
down loading ssd1306 does not work.
@arnoldschmucker9977
@arnoldschmucker9977 Год назад
Redid it based on Paul's suggestion. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-4lWXIBPwA8c.html
@paulmcwhorter
@paulmcwhorter Год назад
LEGEND!
@bigbogeyface
@bigbogeyface Год назад
Here's my homework: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-zybl-Jmnm0I.html I made three: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-jW01OkOuoKE.html This is my favourite 👇 🌧 😌 : ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HBolAtKLQh4.html I also made this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EjdEA_PKU10.html I think it's cool 😎 anyhow 🤷
@nigelworwood8530
@nigelworwood8530 9 месяцев назад
At 17m30s I think I saw a bug in the system😁
@MrTrollified
@MrTrollified Год назад
You resemble James Cameron
@hoellenstein
@hoellenstein 2 месяца назад
Today, I received the tiny display. Eager to connect it, loading the library, writing the code, checking all parameter and voila, it didn't work. Received only cryptic error messages. My OLED display is on 0x3c, on the backside of the oled one can see it and figure that out (if you have perfect eyesight or a magnifying glass) Others in this comment section tried different addresses but no success for me. Eventually, after couple of hours frustrated re-connecting, re-wiring, trying to download different libraries, connecting to different GPIO Pins, it worked. So, i2c = I2C(0, scl=Pin(17), sda=Pin(16)) was it for my tiny displays. To draw a circle, I know there are certain formulas to use, but I simply asked chatGPT and the code worked immidiately. I know, I cheated this time... 😝
@davidh1187
@davidh1187 4 месяца назад
Didn't know the match to generate the points of a circle so had to look it up which effectively gave the whole solution - not sure that is worthy of posting a video for what would have effectively been a copy and paste...... Found 2 solutions - one for a filled circle and the other just for the outline. Here is the solution for the record ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-h_NTJzXIz94.html
@paulmcwhorter
@paulmcwhorter 4 месяца назад
LEGEND!
@WilliamBurlingame
@WilliamBurlingame Год назад
I'm not uploading a video since I let BARD (Google's AI) helped me with the solution. BARD gave me a function for a filled circle. Changing the
@paulmcwhorter
@paulmcwhorter Год назад
Interesting approach, and very different than my solution. Mine is based more on simple math. This is sort of try all possibilities, and keep the ones that match the conditions.
@keithlohmeyer
@keithlohmeyer Год назад
@@paulmcwhorter OK simple as in easy math to code or simple as in NOT needing the math module? I took a deep dive and I am trying to wrap my mind around midpoint circle algorithm and the Bresenham circle algorithm that use addition, subtraction and multiplication to define the pixels for a circle.
@paulmcwhorter
@paulmcwhorter Год назад
Really, I see the simple way to do it is just step through the angles 0 to 360 and then calculate the x and y value of each pixel. x=r*cos(angle) and y=r*sin(angle). Simple as that. All the solutions I have seen so far do special cases for the different quadrants, but above approach does it all in one for loop. You do need to then adjust x and y to get the circle in the middle of the display.
@keithlohmeyer
@keithlohmeyer Год назад
@@paulmcwhorter Yes that will work ok with the more powerful mcu like the Pico. Doing 360 sin and cos functions can slow an old 8 bit mcu down even in Arduino C++. I am going to try doing some timings for the different algorithms and post a video. Someone used the sin and cos method to draw a small circle for the degree symbol. Because it was so small the circle was represented by maybe a dozen pixels. It worked but that was a lot of processing for so few dots.
@WilliamBurlingame
@WilliamBurlingame Год назад
@@paulmcwhorter You haven't introduced any math libraries. I was planning to give a Sunfounder kit to my 11 year old great grandson and suggest the course to him. I doubt that he has had any trig.
@karliskide2460
@karliskide2460 Год назад
Thank you for the amazing lesson! This homework took me a while. Anyways - here is my homework assignment: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yOo-CS_V3mo.html
@DrDave327
@DrDave327 Год назад
Hey, Paul! More great content from you, as usual. Thank you. Here is my solution to the homework: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OzgJsiFD8aQ.html
@paulmcwhorter
@paulmcwhorter Год назад
LEGEND!
@keithlohmeyer
@keithlohmeyer Год назад
Nice job. Thanks for all the mentions but I have not posted my video yet. I am digging way too deep on this. I think my comment thread on William's video might have confused you.
@LorisHW
@LorisHW Год назад
A bit "under the weather" this week. Finally got this homework done. Thanks for the lesson Paul! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE--lTU_bQyTZU.html
@daveslack2755
@daveslack2755 5 месяцев назад
Love these displays. Can't take credit for this homework. New the circle math involved sin and cos but could not remember it and had to google for the calculations. Then had to study them and understand before using. homework ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-0_cbYYYt7hg.html
@larryplatzek9017
@larryplatzek9017 Год назад
this PRIME day 2023 sales on KEPLER kit!
@videonewschannel1212
@videonewschannel1212 5 месяцев назад
using identical hardware and library/ code we get library error File "", line 7, in File "/lib/ssd1306.py", line 110, in __init__ File "/lib/ssd1306.py", line 36, in __init__ File "/lib/ssd1306.py", line 71, in init_display File "/lib/ssd1306.py", line 115, in write_cmd Anyone have suggestions! I even tried a second new 1306 display!
@LeGoat23Lakers
@LeGoat23Lakers Месяц назад
I had the same problem. I solved it by moving the sda and scl to channel 0 and change the code. from machine import Pin, I2C from ssd1306 import SSD1306_I2C import time i2c = I2C(0, sda=Pin(0), scl = Pin(1), freq = 400000) dsp = SSD1306_I2C(128, 64, i2c) msg = 'Hello World!' dsp.text(msg, 0, 0) dsp.show() Hope this helps
@qzorn4440
@qzorn4440 10 месяцев назад
What a wonderful little display at the right hobby price. 🪐 Thank you.
Далее
На фейсконтроле 💂
09:41
Просмотров 718 тыс.
Raspberry Pi Pico LCD Projects
17:25
Просмотров 107 тыс.
SSD1306 OLED Display, In Depth How To Get It Going
46:36
What is VGA and How to Use it With a Raspberry Pi Pico
18:28
Raspberry Pi Pico & SSD1306 Display with MicroPython
1:00:51
КРАХ WINDOWS 19 ИЮЛЯ 2024 | ОБЪЯСНЯЕМ
10:04