Text Editor

Adafruit recommends using the Mu editor for using your CircuitPython code with the Feather boards. You can get more info in this guide.

Alternatively, you can use any text editor that saves files.

Installing Project Code

To use with CircuitPython, you need to first install a few libraries, into the lib folder on your CIRCUITPY drive. Then you need to update code.py with the example script.

Thankfully, we can do this in one go. In the example below, click the Download Project Bundle button below to download the necessary libraries and the code.py file in a zip file. Extract the contents of the zip file, open the directory RGB_Matrix_Protest_Sign/ and then click on the directory that matches the version of CircuitPython you're using and copy the contents of that directory to your CIRCUITPY drive.

Your CIRCUITPY drive should now look similar to the following image:

CIRCUITPY
# SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import board
import displayio
import framebufferio
import rgbmatrix
from adafruit_slideshow import SlideShow

displayio.release_displays()
matrix = rgbmatrix.RGBMatrix(
    width=64,
    height=32,
    bit_depth=5,
    rgb_pins=[board.D6, board.D5, board.D9, board.D11, board.D10, board.D12],
    addr_pins=[board.A5, board.A4, board.A3, board.A2],
    clock_pin=board.D13,
    latch_pin=board.D0,
    output_enable_pin=board.D1,
)

display = framebufferio.FramebufferDisplay(matrix, auto_refresh=True)

slideshow = SlideShow(
    display,
    backlight_pwm=None,
    folder="/images",
    loop=True,
    order=0,
    fade_effect=False,
    dwell=8,
    auto_advance=True,
)


while slideshow.update():
    pass

The code is quite short! We are using the displayio library along with framebufferio and rgbmatrix to do the heavy lifting.

The adafruit_slideshow library makes it simple to auto-play any images in the specified folder. Here's more detail on how to use SlideShow.

Image Files

You can get started using the included image files, or make your own.

From the project .zip, drag the images folder onto the Feather's CIRCUITPY drive.

The program will automatically use any .bmp files in the /images directory. Make sure they have legal names (no spaces or weird characters!) and are 64x32 pixel .bmp files. 16-bit or 24-bit both work fine.

This guide was first published on Jun 23, 2020. It was last updated on Dec 09, 2023.

This page (Code the Protest Sign) was last updated on Dec 09, 2023.

Text editor powered by tinymce.