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

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2024
  • 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 93

  • @jbelmont72
    @jbelmont72 5 หลายเดือนก่อน +1

    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 หลายเดือนก่อน

      Thanks for posting this very helpful solution!

  • @shadowbrookmedia
    @shadowbrookmedia 10 หลายเดือนก่อน +5

    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

  • @rickbonari4493
    @rickbonari4493 10 หลายเดือนก่อน +1

    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 !!!!!

  • @videonewschannel1212
    @videonewschannel1212 หลายเดือนก่อน

    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()

  • @Bob-zg2zf
    @Bob-zg2zf 10 หลายเดือนก่อน

    So beautiful. The scenery. I mean The River Nile.

  • @louistoweill4232
    @louistoweill4232 หลายเดือนก่อน

    I replaced the OLED display with a new one and the circuit worked this time.

  • @Ed-fv9rl
    @Ed-fv9rl 10 หลายเดือนก่อน

    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.

  • @WACkZerden
    @WACkZerden 10 หลายเดือนก่อน

    bravo Great Lesson. Thank You for taking the time to show the basic functions of the display/library.

    • @paulmcwhorter
      @paulmcwhorter  10 หลายเดือนก่อน

      Glad it was helpful!

  • @jorgenonell1108
    @jorgenonell1108 9 หลายเดือนก่อน

    great video Paul!

  • @stephenlightkep1621
    @stephenlightkep1621 10 หลายเดือนก่อน

    Thanks Paul! That was really cool.

    • @paulmcwhorter
      @paulmcwhorter  10 หลายเดือนก่อน

      Glad you liked it!

  • @larryplatzek9017
    @larryplatzek9017 5 หลายเดือนก่อน +2

    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!

    • @user-jv9cu2kc9c
      @user-jv9cu2kc9c 3 หลายเดือนก่อน

      I just copied it and saved it as ssd1306.py

    • @user-gj5fe3dn7j
      @user-gj5fe3dn7j 2 หลายเดือนก่อน

      I got the same problem. not being able to download ssd1306. did you find any solution?

  • @cbrombaugh
    @cbrombaugh 10 หลายเดือนก่อน

    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.

  • @louistoweill4232
    @louistoweill4232 หลายเดือนก่อน

    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.

  • @user-gj5fe3dn7j
    @user-gj5fe3dn7j 2 หลายเดือนก่อน

    Traceback (most recent call last):
    File "", line 1, in
    ImportError: no module named 'ssd1306'

  • @user-jv9cu2kc9c
    @user-jv9cu2kc9c 3 หลายเดือนก่อน

    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.

  • @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  ปีที่แล้ว +2

      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

  • @freddyveza
    @freddyveza 10 หลายเดือนก่อน

    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"...

  • @user-gj5fe3dn7j
    @user-gj5fe3dn7j 2 หลายเดือนก่อน

    installing it come up with version 0.1.0 version only and error while loading it!

  • @ctlancearrowlarson8237
    @ctlancearrowlarson8237 10 หลายเดือนก่อน +1

    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  10 หลายเดือนก่อน +1

      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 2 หลายเดือนก่อน

      "ImportError: no module named 'ssd1306'" does show up after copy and pasting it into thonny.

  • @drdentin3215
    @drdentin3215 10 หลายเดือนก่อน

    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  10 หลายเดือนก่อน +2

      I had a telescope as a kid, but it never turned into a passion for me. So no, no atronomy going on here.

  • @davidh1187
    @davidh1187 2 หลายเดือนก่อน

    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

  • @MartinAlix
    @MartinAlix 8 หลายเดือนก่อน

    Great lesson!
    What happened to that ant? 😂

    • @diggee172
      @diggee172 7 หลายเดือนก่อน

      😅

  • @chikhimngi
    @chikhimngi 10 หลายเดือนก่อน

    hello Paul. Do you have any courses about Django?

  • @user-gj5fe3dn7j
    @user-gj5fe3dn7j 2 หลายเดือนก่อน

    ssd1306 does not work by following your instructions, any help?

    • @robertbowman6599
      @robertbowman6599 2 หลายเดือนก่อน

      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.

  • @AviSchwartz1
    @AviSchwartz1 15 วันที่ผ่านมา

    For me channel 1 gives an [Errno 5] EIO error while channel 0 works fine.

    • @paulmcwhorter
      @paulmcwhorter  14 วันที่ผ่านมา

      Dont understand why, but seems some OLED only work on channel 0 for me. Not sure what is going on.

  • @pralaymajumdar1206
    @pralaymajumdar1206 2 หลายเดือนก่อน

    Just one symbol I want to share with you sir that is❤..

  • @bigbogeyface
    @bigbogeyface 10 หลายเดือนก่อน +4

    Here's my homework:
    th-cam.com/video/zybl-Jmnm0I/w-d-xo.html
    I made three:
    th-cam.com/video/jW01OkOuoKE/w-d-xo.html
    This is my favourite 👇 🌧 😌 :
    th-cam.com/video/HBolAtKLQh4/w-d-xo.html
    I also made this:
    th-cam.com/video/EjdEA_PKU10/w-d-xo.html
    I think it's cool 😎 anyhow 🤷

  • @keithlohmeyer
    @keithlohmeyer 10 หลายเดือนก่อน +1

    Here is my deep dive into ways to plot a circle. th-cam.com/video/3VroWb0Zr3g/w-d-xo.html
    I show 6 different algorithms and time each to see which is fastest.

    • @paulmcwhorter
      @paulmcwhorter  10 หลายเดือนก่อน

      Very interesting. Lots of ways to skin this cat.

  • @user-gj5fe3dn7j
    @user-gj5fe3dn7j 2 หลายเดือนก่อน

    down loading ssd1306 does not work.

  • @keithlohmeyer
    @keithlohmeyer 10 หลายเดือนก่อน +1

    Looks like I am 3rd to post a video showing the the built in method. th-cam.com/video/mg9fBHhFQmw/w-d-xo.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.

  • @deeperlook3234
    @deeperlook3234 9 หลายเดือนก่อน +1

    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 th-cam.com/video/6SdNvqofWww/w-d-xo.html

    • @paulmcwhorter
      @paulmcwhorter  9 หลายเดือนก่อน

      Great video. Thanks.

  • @arnoldschmucker9977
    @arnoldschmucker9977 10 หลายเดือนก่อน +2

    Redid it based on Paul's suggestion. th-cam.com/video/4lWXIBPwA8c/w-d-xo.html

  • @nigelworwood8530
    @nigelworwood8530 7 หลายเดือนก่อน

    At 17m30s I think I saw a bug in the system😁

  • @mrblobby809
    @mrblobby809 หลายเดือนก่อน

    Hi. I'm new to pi Pico. I have some successful programs running ssd1306 oleds 128*32 and 64*32. I've recently purchased some 96*32 and they appear to be ssd1316. When I treat them as 1306 the image is stretched and backwards, any help welcome. Also have some 128*64 on the way ssd1315, am I likely to see same issues on these?

  • @karliskide2460
    @karliskide2460 10 หลายเดือนก่อน +2

    Thank you for the amazing lesson! This homework took me a while. Anyways - here is my homework assignment: th-cam.com/video/yOo-CS_V3mo/w-d-xo.html

  • @MrTrollified
    @MrTrollified 10 หลายเดือนก่อน

    You resemble James Cameron

  • @DrDave327
    @DrDave327 10 หลายเดือนก่อน +2

    Hey, Paul! More great content from you, as usual. Thank you. Here is my solution to the homework:
    th-cam.com/video/OzgJsiFD8aQ/w-d-xo.html

    • @paulmcwhorter
      @paulmcwhorter  10 หลายเดือนก่อน

      LEGEND!

    • @keithlohmeyer
      @keithlohmeyer 10 หลายเดือนก่อน

      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.

  • @davidh1187
    @davidh1187 2 หลายเดือนก่อน

    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 th-cam.com/video/h_NTJzXIz94/w-d-xo.html

  • @WilliamBurlingame
    @WilliamBurlingame 10 หลายเดือนก่อน

    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  10 หลายเดือนก่อน

      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 10 หลายเดือนก่อน

      @@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  10 หลายเดือนก่อน

      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 10 หลายเดือนก่อน

      @@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 10 หลายเดือนก่อน

      @@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.

  • @videonewschannel1212
    @videonewschannel1212 3 หลายเดือนก่อน

    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!

  • @LorisHW
    @LorisHW 10 หลายเดือนก่อน +3

    A bit "under the weather" this week. Finally got this homework done. Thanks for the lesson Paul! th-cam.com/video/-lTU_bQyTZU/w-d-xo.html

  • @daveslack2755
    @daveslack2755 3 หลายเดือนก่อน

    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 th-cam.com/video/0_cbYYYt7hg/w-d-xo.html

  • @qzorn4440
    @qzorn4440 7 หลายเดือนก่อน

    What a wonderful little display at the right hobby price. 🪐 Thank you.

  • @larryplatzek9017
    @larryplatzek9017 10 หลายเดือนก่อน

    this PRIME day 2023 sales on KEPLER kit!