TFT LCD Display Example¶
The TFT LCD Display Example shows how to use the LCD library API functions to draw graphic objects on the LCD.
The table below shows the connections of each pin of the TFT LCD driver ST7789:
|LCD Pin||nRF52840 Pin||Name|
Before you start coding, the Python Interpreter should be installed on the nRF52840 M.2 module correctly:
Run the code¶
Run the TFT LCD Display Example by performing the following steps:
Connect the Module USB port to your PC as shown in the figure below. A disk drive called CIRCUITPY should be automatically detected by the computer:
code.pyfile on your CIRCUITPY drive, then copy and paste the following code. Your code will run as soon as the file is done saving.
import board import digitalio import displayio import time from lcd import LCD displayio.release_displays() spi = board.SPI() display_bus = displayio.FourWire( spi, command=board.LCD_DC, chip_select=board.LCD_CS, reset=board.LCD_RST ) display = LCD(display_bus, width=240, height=240, rowstart=80, rotation=90, backlight_pin=board.LCD_BL)
screen /dev/cu.usbmodem14102 115200
Type something in the terminal window. Observe that the LCD will display the same thing as in the terminal:
Create an Issue¶
Interested in contributing to this project? Want to report a bug? Feel free to click here: