It's easy to use display breakouts with Python and the Adafruit CircuitPython RGB Display module. This module allows you to easily write Python code to control the display.
Since there's dozens of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, please visit the guide for CircuitPython on Linux to see whether your platform is supported.
You can wire up the TFT to your Raspberry Pi using a breadboard, EYESPI breakout or EYESPI Pi Beret.



- Pi 3V to breakout VIN (red wire)
- Pi GND to breakout GND (black wire)
- Pi SLCK (GPIO 11) to breakout SCK (blue wire)
- Pi MISO (GPIO 9) to breakout MISO (green wire)
- Pi MOSI (GPIO 10) to breakout MOSI (yellow wire)
- Pi CE0 (GPIO 8) to breakout TCS (purple wire)
- Pi GPIO 25 to breakout DC (white wire)
- Pi GPIO 27 to breakout RST (pink wire)
Attach the TFT screen to the EYESPI breakout with an EYESPI cable as described on the Plugging in an EYESPI Cable page.
The following is the TFT wired to a Raspberry Pi using a solderless breadboard:
- Pi 3V to TFT V+ (red wire)
- Pi GND to TFT G (black wire)
- Pi SLCK (GPIO 11) to TFT SCK (blue wire)
- Pi MISO (GPIO 9) to TFT MISO (green wire)
- Pi MOSI (GPIO 10) to TFT MOSI (yellow wire)
- Pi CE0 (GPIO 8) to TFT TCS (purple wire)
- Pi GPIO 25 to TFT DC (white wire)
- Pi GPIO 27 to TFT RST (pink wire)
Software Setup
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This may also require enabling SPI on your platform and verifying you are running Python 3. Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready!
Python Installation of RGB Display Library
Once that's done, from your command line run the following command:
sudo pip3 install adafruit-circuitpython-rgb-display
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!
If that complains about pip3 not being installed, then run this first to install it:
sudo apt-get install python3-pip
DejaVu TTF Font
Run the following command to install the DejaVu font:
sudo apt-get install fonts-dejavu
Pillow Library
We also need PIL, the Python Imaging Library, to allow graphics and using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:
sudo apt-get install python3-pil
If you installed the PIL through PIP, you may need to install some additional libraries:
sudo apt-get install libopenjp2-7 libtiff5 libatlas-base-dev
Blinka JPEG
Save the JPEG image of Blinka in the same directory as your code.py file. You can download the image from here or through the Project Bundle from GitHub.
Python Usage
Once you have all of the requirements installed on your Raspberry Pi, copy or download the following example, and run the following, replacing code.py with whatever you named the file:
python3 code.py
# SPDX-FileCopyrightText: 2025 Liz Clark for Adafruit Industries # SPDX-FileCopyrightText: Adapted from Melissa LeBlanc-Williams's Pi Demo Code # # SPDX-License-Identifier: MIT '''Raspberry Pi Graphics example for the 240x240 Round Display''' import time import digitalio import board from PIL import Image, ImageDraw, ImageFont from adafruit_rgb_display import gc9a01a BORDER = 20 FONTSIZE = 24 cs_pin = digitalio.DigitalInOut(board.CE0) dc_pin = digitalio.DigitalInOut(board.D25) reset_pin = digitalio.DigitalInOut(board.D27) BAUDRATE = 24000000 spi = board.SPI() disp = gc9a01a.GC9A01A(spi, rotation=0, width=240, height=240, x_offset=0, y_offset=0, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE, ) width = disp.width height = disp.height # -------TEXT AND SHAPES--------- image1 = Image.new("RGB", (width, height)) draw1 = ImageDraw.Draw(image1) draw1.ellipse((0, 0, width, height), fill=(0, 255, 0)) # Green background draw1.ellipse( (BORDER, BORDER, width - BORDER - 1, height - BORDER - 1), fill=(170, 0, 136) ) font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", FONTSIZE) text = "Hello World!" (font_width, font_height) = font.getsize(text) draw1.text( (width // 2 - font_width // 2, height // 2 - font_height // 2), text, font=font, fill=(255, 255, 0), ) # ------ADABOT JPEG DISPLAY---------- image2 = Image.open("blinka_round.jpg") image_ratio = image2.width / image2.height screen_ratio = width / height scaled_width = width scaled_height = image2.height * width // image2.width image2 = image2.resize((scaled_width, scaled_height), Image.BICUBIC) x = scaled_width // 2 - width // 2 y = scaled_height // 2 - height // 2 image2 = image2.crop((x, y, x + width, y + height)) while True: disp.image(image1) # show text time.sleep(2) disp.image(image2) # show adabot time.sleep(2)
You'll see the graphics example show on the TFT. First, you'll see a purple circle on top of a green circle with the text "Hello World!" in the center. Then, you'll see the Blinka JPEG displayed. These two images will swap back and forth in the loop.
Page last edited February 11, 2025
Text editor powered by tinymce.