Raspberry Pi Pico OLED (SSH1106) display tutorial using Arduino

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Dear friends, welcome back! In this video I am  going to show you how to connect this 1.3” OLED   display to a Raspberry Pi Pico board. I will also  show you how to use it with Arduino and I will   share with you 3 useful projects to help you get  started and save you a lot of time. Let’s start.  I recently discovered this OLED display and  I wanted to try it out because it is bigger   in size than the OLED display I was using so  far which is 1” in diagonal. The new display   is 1.3” in diagonal, which makes it a lot bigger. Similar to other OLED displays, this display has   an excellent contrast and low power consumption. The display has a resolution of 128x64 pixels,   it is monochrome and it uses the I2C interface to  communicate with the microcontroller. This makes   the connection to the Raspberry Pi Pico extremely  easy. All we have to do is to connect power and   two more wires. Let’s see how to connect it. The first pin of the display is the GND pin,   so we connect it to a GND pin of the Raspberry Pi  Pico board. The second pin is VCC so we connect   it to the 5V output of the Raspberry Pi Pico  board. The next pin is named SCL and we connect   it to pin GP5 which is right here, it’s the  7th pin of the board. The last pin is named   SDA and we connect it to pin GP4 which is pin  number 6. That’s it, our connections are ready.  Let’s power up the board to see what happens. As  you can see I have loaded a demo sketch to it,   and it displays a “Hello World” message.  Beautiful, our hardware setup is working fine.  Let’s now see the software we need to drive  this display. I am going to use Arduino today,   so I open up the latest version of the  Arduino IDE at the time of this recording.  All we have to do is to click here, at the Library  Manager button, search for the excellent GyverOLED   library and press the install button. Now that  the library is installed we can use it at once.  As you can see the code of the first  example is very simple. All we do is we   create an oled object and we simply call some  methods. At first we initialise the display,   and then we clear it and we call the update  method to reflect the changes to the screen.   Next we set the cursor to the desired, X and Y  coordinates on the screen, and we print the Hello   World message with the print method. Next we draw  a frame around the screen with the rect method,   and lastly we send all the changes to the  display with the update method. Easy, isn’t it?  The second example is a program that displays  the temperature using a DHT22 sensor. I have   connected the sensor to pin GP15. I have also  included the DHT library to make it work. As   you can see, the project is working fine and  it updates the temperature every two seconds.  The library only supports English and Russian  text printing. But if we want to print the User   Interface in another language we can load  it as a bitmap and only print the numbers   for the temperature with the library. For  example, in Photoshop I created a new .bmp   file with dimensions 128x64 pixels with the text  “temperature” in Greek. I saved it as a .bmp file   and loaded it into the LCDAssistant software. I  then saved it to a .c file. The software created   a byte array that I can use in my sketch. I  just have to copy and paste it in my program.   Now instead of printing the text and drawing a  frame using the library I just call the drawBitmap   function. Cool huh! Our project now speaks Greek. By the way, If you find what I just shared with   you useful, give this video a  like so more people can learn   about this easy procedure. Thank you very much. The last project I want to share with you is a   Pong game where the cpu controls both paddles.  I wanted to see if the display can update fast   enough to allow us to develop games with it. As  you can, it is pretty fast. When I first ran the   program I was disappointed because the frame rate  was not as fast, it was barely playable. But after   some search, I discovered that if we manually  set the I2C bus frequency at 800KHz the display   works fast! Very cool! As always you can find the  code of the projects in the video description. So, this display is really fast using Arduino and  I am going to use it a lot in the future. I am   using Arduino and not CircuitPython or MicroPython  because it is way faster in execution time. Please   check the video comparison I did to see for  yourself. If speed is an issue for your project,   Arduino is the way to go. Thanks for  watching, I will see you next time.
Info
Channel: educ8s.tv
Views: 13,539
Rating: undefined out of 5
Keywords: educ8s, educ8s.tv, DIY, easy project, Arduino
Id: aPYCJmTf_fc
Channel Id: undefined
Length: 5min 21sec (321 seconds)
Published: Wed Jan 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.