SSD1306 With Raspberry Pi Pico

by tonygo2 in Circuits > Raspberry Pi

16267 Views, 50 Favorites, 0 Comments

SSD1306 With Raspberry Pi Pico

Start.jpg

I've been playing with the new Raspberry Pi Pico microcontroller and have been using it to drive a cheap and simple SSD1306 display with 128 x 64 pixels.

This Instructable will show you how to install the necessary driver, connect up your Pico and the display, draw text, lines, rectangles and circles on your screen, bounce an icon around the screen and print a scrolling message in a Sine curve.

Supplies

Raspberry Pi Pico - with legs soldered on

Breadboard or Pimoroni base

SSD1306 display

connecting jumper wires

Installing the SSD1306.py Library

I am going to assume that you have installed the Pico UF2 file to your Pico, installed the Thonny Editor on your computer, know how to connect your Pico to your computer's USB port, enter and run code from Thonny.

Load the ssd1306.py script into Thonny and save it to the Pico.

Make the following connections:

SSD1306 VCC to Pico 3.3V

SSD1306 GND to Pico GND

SSD1306 SDA to Pico GP4

SSD1306 SCL to Pico GP5

Downloads

Run the Demo Program

Raspberry Pi Pico and SSD1306 display

Download SSD1306 DemoV3.py script. Load it into Thonny and run it. The video shows what should happen.

Downloads

Section 1

1-43.jpg

This section loads the necessary libraries and defines the Raspberry icon and some simple routines for drawing lines and a hollow box.

Section 2

44-72.jpg
Start.jpg

Here we have the routine to draw a ring/circle and we try out the routines with a static screen.

Section 3

73-108.jpg
Bounce.jpg

This part bounces the raspberry icon around inside the box and does the calculations for the last section by defining a path on which to display some text.

Section 4

Scroll.jpg

Here we display the message on the predefined Sine curve path. Try changing the message.

I hope you have managed to get this working and enjoy the result. You now have a tested starting point for your own projects.

Questions and comments welcome