ST7789 Display

The S3 MINI PRO used in this course includes an onboard 0.85-inch 128 × 128 TFT display controlled by the ST7789 display controller.

The display provides a visual output interface that can be used for:

    • Text

    • Numbers

    • Shapes

    • Graphics

    • Images

    • Animations

    • Clocks

    • Menus

    • Sensor information

    • Interactive programs

    • Simple games


1. Display Specifications

Feature Description
Display Type TFT LCD
Controller ST7789
Screen Size 0.85 inch
Resolution 128 × 128 pixels
Communication SPI
Board WEMOS S3 MINI PRO


2. Display Connections

The display is already connected internally to the ESP32-S3, so no external wiring is required.

Display Function GPIO
Backlight GPIO33
Reset GPIO34
Chip Select (CS) GPIO35
Data / Command (DC) GPIO36
MOSI GPIO38
SCK / Clock GPIO40
ESP32-S3
|
|-- GPIO33 --> Backlight
|-- GPIO34 --> Reset
|-- GPIO35 --> Chip Select
|-- GPIO36 --> Data / Command
|-- GPIO38 --> MOSI
|-- GPIO40 --> Clock
|
v
ST7789 TFT Display

3. SPI Communication

SPI stands for Serial Peripheral Interface.

Signal Purpose
SCK Provides the communication clock
MOSI Sends display data from the ESP32-S3
CS Selects the display
DC Indicates whether data is a command or display data
RST Resets the display
BL Controls the backlight


4. Display Driver

The MicroPython driver used during the course is:

st7789_mpy

The driver provides functions for:



    • Initializing the display

    • Filling the screen with colours

    • Drawing pixels

    • Lines

    • Rectangles

    • Circles

    • Polygons

    • Displaying text

    • Fonts

    • JPG images

    • PNG images

    • Scrolling

    • Rotation


5. Basic Display Process

Import Modules
|
v
Configure SPI
|
v
Configure Display Pins
|
v
Create ST7789 Object
|
v
Initialize Display
|
v
Draw Text / Graphics / Images


6. Display Coordinate System

The screen resolution is:

128 × 128 pixels

Top-left normally starts at:

X = 0
Y = 0

(0,0) -----------------> X
|
|
|
v
Y


7. Colours

The display can show colours such as:



    • Black

    • White

    • Red

    • Green

    • Blue

    • Yellow

    • Cyan

    • Magenta


8. Displaying Text

A text operation normally requires:



    • Font

    • Text

    • X position

    • Y position

    • Text colour

    • Background colour


9. Fonts

Fonts can be used for:



    • Small text

    • Large headings

    • Clock displays

    • Decorative text

    • User interfaces


10. Graphics and Shapes

The display driver can draw:



    • Pixels

    • Lines

    • Rectangles

    • Filled rectangles

    • Circles

    • Filled circles

    • Polygons


11. JPG Images

Course example:

jpg_test.py

This demonstrates:



    • Loading an image

    • Decoding JPG data

    • Positioning the image

    • Rendering it on the TFT


12. PNG Images

Examples:

png_test.py
png_slideshow.py

These introduce:



    • Image loading

    • Lists

    • Loops

    • Timing

    • Sequential image display

    • Screen updates


13. NASA Image Examples

NASA images were used to demonstrate:



    • Image rendering

    • Background images

    • Image switching

    • Combining images and text

    • Visual quality of the display


14. Clock Example

The clock example combines:

Display
+
Background Image
+
Font
+
Real-Time Clock
+
Buttons


15. Examples Explored

File Purpose
hello_test.py Basic text/display test
jpg_test.py JPG image rendering
png_test.py PNG image rendering
png_slideshow.py Displays multiple PNG images sequentially
nasa_clock_test.py Displays a clock over a NASA background

16. Modifying the Examples

Possible modifications include:

    • Changing displayed text

    • Changing colours

    • Moving text

    • Changing fonts

    • Changing background images

    • Changing image order

    • Changing slideshow delay

    • Adding buttons

    • Modifying the clock

    • Adding animations

    • Combining text and images


17. Buttons and the Display

Button Press
|
v
Program Detects Input
|
v
Change Display

Buttons can be used to:

    • Change images

    • Change screens

    • Increase or decrease values

    • Adjust a clock

    • Move objects

    • Navigate menus

    • Control games


18. Animation

Draw Object
|
v
Wait
|
v
Erase / Redraw
|
v
Change Position
|
v
Repeat

19. Pong / Ping-Pong Game

A simple Pong program could combine:

Display
+
Graphics
+
Buttons
+
Timing
+
Game Logic

The display could draw:

    • Ball

    • Paddle or paddles

    • Score


20. Avoiding Unnecessary Global Variables

def show_home_screen(tft):
# Draw the home screen
pass

This makes programs easier to:

    • Read

    • Modify

    • Test

    • Debug

    • Reuse


21. What to Explore

Experiment with:

    • Text

    • Fonts

    • Colours

    • Lines

    • Rectangles

    • Circles

    • Images

    • JPG

    • PNG

    • Slideshows

    • Scrolling

    • Rotation

    • Animation

    • Buttons

    • Interactive interfaces

    • Simple games


22. Key Lesson

MicroPython Program
|
v
ST7789 Driver
|
v
SPI Communication
|
v
ESP32-S3 GPIO
|
v
ST7789 Controller
|
v
TFT Display
|
v
Text / Graphics / Images

The objective is not simply to make something appear on the display, but to understand how the MicroPython driver communicates with and controls the display hardware.
Topic revision: r1 - 19 Nov 2026, JamesInkoom