Lately, I’ve been diving into the world of simple graphic elements and finding ways to render them on a compact SSD1306, similar to those I’ve used in other projects like SpaceHex - Github.
In this post, we’ll explore the development process of a modular display-based tool using the RP2040 Pi Pico and an SSD1306 OLED display with Micropython.
Getting started Link to heading
I created a new repo that focuses on overcoming unexpected obstacles that one might face when getting started.
While working on the code, I referred to a wealth of Micropython documentation, including:
- The official Micropython documentation
- Specifically, Framebuf
- Official Raspberry Pi Pico documentation
I utilized a highly customized version of the Adafruit SSD1306 Python Library.
Demo Link to heading
To run the demo code, you’ll need an RP2040 Pi Pico board, an SSD1306 OLED, Micropython installed on your board, and a compatible development environment.
Alternatively,
You can follow along with the Wokwi web RP2040 simulator.
Setting up the Hardware: Link to heading
- Connect the SSD1306 OLED display to the RP2040 Pi Pico board by wiring the appropriate pins.
- OLED VCC to Pico 3V3 pin
- OLED GND to Pico GND pin
- OLED SCL to Pico GP1 pin
- OLED SDA to Pico GP0 pin
- Install Micropython on your RP2040 Pi Pico board by following the instructions provided.
Running the Demo(s): Link to heading
- Clone the repo and navigate to the
pico-oled-demo
directory. - Use
rshell
to copy a demo to the Pico and connect to the REPL. - Reset the Pico to start the program, or use the manual method to run the demo by copying the demo code to a file named
main.py
on your RP2040 Pi Pico board.
Next? Link to heading
Getting back to doing some cool matrix math transformations and 3-D vector-space drawings
Conclusion: Link to heading
This project showcases the versatility and potential of the RP2040 Pi Pico and SSD1306 OLED display in creating modular display-based tools. By using Micropython and the provided demo code, you can quickly build and experiment with various graphics and display elements.