Allow us to demonstrate how to get started with these outstanding displays. This how-to has been updated to include sections on drawing shapes and objects to the display, converting bitmap images for OLED displays, and animating images.
The original article was written as follows:
When it comes to digital displays, the Raspberry Pi Pico has a plethora of options. We can use LCD screens with VGA or DVI output, or we can use bespoke screens such as the Pico Display or the IPS display on the Pico Explorer Base. However, there are times when a small, low-cost solution is required to complete the task. Using small oled display OLED screens, such as the 0.96-inch model used in this tutorial, is simple and inexpensive (a few dollars or pounds), making them an excellent choice for projects.
In this tutorial, we will learn how to connect an OLED screen to a Raspberry Pi Pico using the I2C interface, then we will install a MicroPython library using the Thonny editor and learn how to use it to write text to the display.
When communicating with the Raspberry Pi Pico, the STN LCD and OLED screen communicates via the I2C protocol. This means that we only require what we need.
A Raspberry Pi Pico with MicroPython running on it, as well as four Female to Female jumper wires.
An I2C OLED display with a resolution of 128 x 64
How to connect an OLED screen to a Raspberry Pi Pico
Make use of the wiring diagram that follows.
1. Connect the GND of the screen to any GND on the Pico (the black wire).
2. Connect VDD / VCC to 3V3 on the Pico (Red wire) and power up the Pico.
3. Connect SCK / SCL to I2C0 SCL (GP1, Physical pin 2, orange wire).
GP0, Physical pin 1, Yellow wire) and SDA (GP0, Physical pin 1, Yellow wire) to I2C0.
5. Connect your Raspberry Pi Pico to your computer and launch the Thonny application.
We now need to install a library in order for Python to communicate with the screen, which we can do once the hardware is connected and Thonny is open.
6. Select Tools Manage Packages to access Thonny's Python library package manager.
7. In the search bar, type "ssd1306" and then click "Search on PyPI."