Graphics on a SSD1306 I2C OLED 128x64 Display With CircuitPython Using an Itsybitsy M4 Express

The SSD1306 OLED display is a small (0.96”), inexpensive, widely available, I2C, monochrome graphical display with 128x64 pixels, which is easily interfaced (only 4 wires) to microprocessor development boards such as a Raspberry Pi, Arduino or Adafruit Itsybitsy M4 Express, CircuitPlayground Express or other CircuitPython devices. Drivers can be downloaded from the internet.
Graphical routines for Arduinos have been available for some time but not for other development systems.

The basic device drivers allow users to :

Clear the screen to black or white. oled.fill(c)
Write a text string to the screen at a specified (x, y) position oled.text(“Text”, x, y, c)
Draw a dot at a specified (x, y) position oled.pixel(x, y, c)
Load a picture file to the screen. (Not used in this project)
Update the display
This Instructable will demonstrate, with simple procedures, how to draw, interactively:

hollow boxes
solid blocks
pre-defined characters
I will be using an Adafruit Itsybitsy M4 Express to demonstrate the methods but the code, in Python, can easily be ported to other development systems.

I chose the Itsybitsy M4 for this demonstration because it is inexpensive, powerful, easy to program, includes analogue and digital Input/Output, has plenty of memory, has easily located documentation and help forums on the Internet, is very easy to set up initially and supports CircuitPython, a version of Python ideal for those new to coding.

Once you have set up your Itsybitsy and SSD1306 this is a very simple breadboard build. There is no typing, all the files can be downloaded.

This is an inexpensive and easy project to build but introduces some intermediate/advanced ideas. I hope you will give it a try. I was impressed with this little display.”


Related Content