There's two ways you can use the 1.3" 240x240 display.

Be aware that you can only choose to do one way at a time. If you choose the hard way, it will install the kernel driver, which will prevent you from doing it the easy way without uninstalling the driver first.

The easy way is to use 'pure Python 3' and Pillow library to draw to the display from within Python. This is great for showing text, stats, images etc that you design yourself. If you want to do that, skip this page and go to the Python Setup page.

The hard way is to install a kernel module to add support for the TFT display that will make the console appear on the display. This is cute because you can have any program print text or draw to the framebuffer (or, say, with pygame) and Linux will take care of displaying it for you. If you don't need the console or direct framebuffer access, please consider using the 'pure Python' technique instead as it is not as delicate.

We don't recommend using the 240x240 display for GUI/PIXEL desktop, this is only for text console usage. The display is waaay too small for a desktop

Prepare the Pi!

Before you begin, its a good idea to get your Pi completely updated and upgraded. We assume you have burned an SD card and can log into the console to install stuff.

Run

sudo apt update -y
sudo apt-get update -y
sudo apt-get upgrade -y

To fully update and upgrade your Pi!

Setup Virtual Environment

If you are installing on the Bookworm version of Raspberry Pi OS or later, you will need to install your python modules in a virtual environment. You can find more information in the Python Virtual Environment Usage on Raspberry Pi guide. To Install and activate the virtual environment, use the following commands:

sudo apt install python3.11-venv
python -m venv env --system-site-packages

To activate the virtual environment:

source env/bin/activate

After that is complete run

sudo shutdown -h now

to shutdown the Pi safely. Remove power and attach the bonnet.

Attach power to the Pi and re-log in. Unlike similar displays, this PiTFT's backlight is controlled separately by GPIO 26, which is off by default, so you won't see the it lit up just yet.

Run the following at the terminal

cd ~
sudo apt-get install -y git python3-pip
sudo pip3 install --upgrade adafruit-python-shell click
git clone https://github.com/adafruit/Raspberry-Pi-Installer-Scripts.git
cd Raspberry-Pi-Installer-Scripts
sudo -E env PATH=$PATH python3 adafruit-pitft.py --display=st7789v_bonnet_240x240 --rotate=0 --install-type=console

When you get asked to reboot, reboot!

Zat's it! You will now have the miniPiTFT with a console display on it

This guide was first published on Jun 25, 2020. It was last updated on Mar 26, 2024.

This page (Kernel Module Install) was last updated on Mar 08, 2024.

Text editor powered by tinymce.