# Adafruit 1.47" Round Rectangle TFT Display

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/110/164/medium800thumb/adafruit_products_5393-10.jpg?1648222513)

Don't be such a&nbsp;_square_&nbsp;- throw a curveball into your electronics with a curved-edge miniature display. Here's a new "round rect" TFT display&nbsp;- it's 1.47" diagonal and has high-density 250 ppi, 172x320 full-color pixels with IPS any-angle viewing. We've seen displays of this caliber used in smartwatches and small electronic devices, but they've always been MIPI interface. Finally, we found one that is SPI and has a friendly display driver, so it works with any and all microcontrollers or microcomputers!

![](https://cdn-learn.adafruit.com/assets/assets/000/110/165/medium800/adafruit_products_5393-05.jpeg?1648222681)

This lovely little display breakout is the best way to add a small, colorful, and very bright display to any project. Since the display uses 4-wire SPI to communicate and has its own pixel-addressable frame buffer, it can be used with every kind of microcontroller. Even a very small one with low memory and few pins available! The 1.47" display has 172x320 16-bit full color&nbsp;pixels and is an&nbsp; **IPS** &nbsp;display, so the color looks great up to 80 degrees off-axis in any direction. The TFT driver (ST7789) is very similar to the popular ST7735, and our Arduino library supports it well.

![](https://cdn-learn.adafruit.com/assets/assets/000/110/166/medium800/adafruit_products_5393-02.jpeg?1648222732)

Note that the way we get the rounded corners is by&nbsp;_deleting_&nbsp;pixels. The corner pixels are still addressed in RAM, they just don't appear, so it isn't like you have to do some special radial-pixel mapping. Treat it like a rectangular display.

![](https://cdn-learn.adafruit.com/assets/assets/000/110/167/medium800/adafruit_products_5393-04.jpeg?1648222789)

The breakout has the TFT display soldered on (it uses a delicate flex-circuit connector) as well as an ultra-low-dropout 3.3V regulator, auto-reset circuitry, and a 3/5V level shifter so you can use it with 3.3V or 5V power and logic. We also had a little extra space, so we placed a microSD card holder so you can easily load full color bitmaps from a FAT16/FAT32 formatted microSD card. The microSD card is not included,&nbsp;[but you can pick one up here](https://www.adafruit.com/product/5251).

![](https://cdn-learn.adafruit.com/assets/assets/000/110/168/medium800/adafruit_products_5393-01.jpeg?1648222940)

Of course, we wouldn't just leave you with a datasheet and a "good luck!" -&nbsp;[we've written a full open-source graphics Arduino library that can draw pixels, lines, rectangles, circles, text, and bitmaps as well as example code](https://github.com/adafruit/Adafruit-ST7735-Library). The code is written for Arduino but can be easily ported to your favorite microcontroller! Wiring is easy, we strongly encourage using the hardware SPI pins of your Arduino as software SPI is noticeably slower when dealing with this size display.&nbsp;[For Raspberry Pi or other Single Board Computer Python users, we have a user-space Pillow-compatible library](https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display). For&nbsp;[CircuitPython there's a displayio driver for native support](https://github.com/adafruit/Adafruit_CircuitPython_ST7789).

![](https://cdn-learn.adafruit.com/assets/assets/000/110/169/medium800/adafruit_products_5393-03.jpeg?1648222956)

This display breakout also features an 18-pin "EYE SPI" standard FPC connector with a flip-top connector. You can use an 18-pin 0.5mm pitch FPC cable to connect to all the GPIO pins, for when you want to skip the soldering.

**Please note!&nbsp;** This display is designed originally for smartwatches and similar, where there's a glass over the screen. Without something gently holding the screen down, the backlight can eventually peel away from the TFT. (It's not destructive but it may be unattractive) You can prevent this by, ideally, adding a plastic or glass cover/overlay. If using bare, try dabbing a touch of E6000 or similar craft glue on the thin side edges, or using a thin piece of tape to keep the front TFT attached to the backlight.

![](https://cdn-learn.adafruit.com/assets/assets/000/110/170/medium800/adafruit_products_5393-07.jpeg?1648222995)

# Adafruit 1.47" Round Rectangle TFT Display

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/110/161/medium800/adafruit_products_Pinouts_-_Split_Image.jpg?1648221317)

## Power Pins

- **V+ / VIN** - This is the power pin. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 3V microcontroller like a Feather M4, use 3V, or for a 5V microcontroller like Arduino, use 5V.
- **3V / 3Vo** - This is the output from the onboard 3.3V regulator. If you have a need for a clean 3.3V output, you can use this! It can provide at least 100mA output.
- **G / Gnd** - This is common ground for power and logic.

## SPI Pins

- **CK / SCK** - this is the **S** PI **C** loc **k** pin. Use 3-5V logic level.
- **SI / MOSI** - this is the **S** erial **Da** ta In / **M** icrocontroller **O** ut **S** ensor **I** n pin. It is used to send data from the microcontroller to the SD card and/or TFT. Use 3-5V logic level
- **SO / MISO** - this is the **S** erial **D** ata **O** ut / **M** icrocontroller **I** n **S** ensor **O** ut pin. It is used for the SD card. It isn't used for the TFT display which is write-only. It is 3.3V logic out (but can be read by 5V logic)
- **TC / TFTCS** - this is the&nbsp; **TFT**  **C** hip **S** elect pin. Use 3-5V logic level

## Other Pins

- **RT / RST** - This is the TFT reset pin. Connect to ground to reset the TFT! It's best to have this pin controlled by the library so the display is reset cleanly, but you can also connect it to the microcontroller Reset pin, which works for most cases. There is an automatic-reset chip connected so it will reset on power-up. Use 3-5V logic level
- **DC** - This is the TFT SPI data or command selector pin. Use 3-5V logic level
- **CC / SDCS** - This is the SD card chip select pin, used if you want to read from the SD card. Use 3-5V logic level
- **BL / Lite** - This is the PWM input for the backlight control. It is by default pulled high (backlight on) you can PWM at any frequency or pull down to turn the backlight off. Use 3-5V logic level

## EYE SPI 18-pin FPC Connector

1. VIN (3 to 5V DC power)
2. Backlight (3~5V logic, PWM optional input)
3. Ground
4. SPI Clock (3~5V logic in)
5. SPI MOSI (3~5V logic Microcontroller Out, Screen/SD In)
6. SPI MISO (3~5V logic Microcontroller In, Screen/SD Out)
7. TFT Data/Command (3~5V logic in)
8. TFT Reset (optional 3~5V logic in)
9. TFT SPI Chip Select (3~5V logic in)
10. SD Card SPI Chip Select (3~5V logic in)
11. Unused
12. Unused
13. Unused
14. Unused
15. Unused
16. Unused
17. Unused
18. Unused

# Adafruit 1.47" Round Rectangle TFT Display

## Arduino Wiring & Test

![](https://cdn-learn.adafruit.com/assets/assets/000/110/171/medium800thumb/adafruit_products_5393-11.jpg?1648224239)

# Basic Graphics Test Wiring

Wiring up the display in SPI mode is pretty easy as there's not that many pins! This is using hardware SPI, but you can also use software SPI (any pins) later. Start by connecting the power pins

- **3-5V Vin** or **V+** connects to the microcontroller **5V** pin
- **Gnd** &nbsp;or **G&nbsp;** connects to Arduino ground
- **SCK** &nbsp;or **CK** connects to SPI clock. On Arduino Uno/Duemilanove/328-based, that's **Digital 13**. On Mega, it's **Digital 52** and on other boards it's **ICSP-3** ([See SPI Connections for more details](http://arduino.cc/en/Reference/SPI))
- **MISO** or **SO** is not connected
- **MOSI** or **SI** connects to SPI MOSI. On Arduino Uno/Duemilanove/328-based, that's **Digital 11**. On Mega, it's **Digital 51** and on other boards it's **ICSP-4** ([See SPI Connections for more details](http://arduino.cc/en/Reference/SPI "Link: http://arduino.cc/en/Reference/SPI"))
- **TCS** &nbsp;or **TC** connects to the SPI Chip Select pin. This uses **Digital 10** but you can later change this to any pin.
- **RST** &nbsp;or **RT** connects to the Display Reset pin. This uses **Digital 9** but you can later change this pin too.
- **DC** connects to our SPI data/command select pin. We'll be using **Digital 8** but you can later change this pin too.

For the built-in level shifter, the board uses a [CD74HC4050](http://www.ti.com/product/cd74hc4050?keyMatch=CD74HC4050&tisearch=Search-EN-Everything) chip, which has a typical propagation delay of ~10ns

![](https://cdn-learn.adafruit.com/assets/assets/000/110/193/medium800/adafruit_products_1.47_Wiring_and_Test_bb.jpg?1648226915)

# Install Arduino Libraries

Adafruit has example code ready to go for use with these TFTs. It's written for Arduino, which should be portable to any microcontroller by adapting the C++ source.

_Five_ libraries need to be installed using the **Arduino Library Manager** …this is the preferred and modern way. From the Arduino “Sketch” menu, select “Include Library” then “Manage Libraries…”

![](https://cdn-learn.adafruit.com/assets/assets/000/079/139/medium800/adafruit_products_arduino_compatibles_manage-libraries.png?1565122046)

Type “7789” in the search field to quickly find the first library — **Adafruit ST7735 and ST7789 Library** :

![](https://cdn-learn.adafruit.com/assets/assets/000/104/415/medium800/circuitpython_ST7789_Arduino_Lib.png?1631126475)

Arduino should ask you about installing dependencies. Be sure to chose "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/104/416/medium800/circuitpython_Arduino_Dependencies.png?1631126702)

Repeat the search and install steps for the remaining libraries, looking for **Adafruit Zero DMA** , **&nbsp;Adafruit SPIFlash** , and **SdFat - Adafruit Fork**.

After restarting the Arduino software, you should see a new **example** folder called **Adafruit ST7735 and ST7789 Library,&nbsp;** and inside, an example called **graphicstest\_st7789**.

![](https://cdn-learn.adafruit.com/assets/assets/000/110/136/medium800/st7789_arduino_wiring___test_Screen_Shot_2022-03-24_at_10.26.46_AM.png?1648143114)

Since this example is written for several displays, there is just one change needed in order to use it with the this display.

You just need to set the correct initialization sequence. In the **graphicstest\_st7789** source code, look for the lines as follows:

```cpp
// Use this initializer (uncomment) if using a 1.3" or 1.54" 240x240 TFT:
tft.init(240, 240);           // Init ST7789 240x240

// OR use this initializer (uncomment) if using a 1.69" 280x240 TFT:
//tft.init(240, 280);           // Init ST7789 280x240

// OR use this initializer (uncomment) if using a 2.0" 320x240 TFT:
//tft.init(240, 320);           // Init ST7789 320x240

// OR use this initializer (uncomment) if using a 1.14" 240x135 TFT:
//tft.init(135, 240);           // Init ST7789 240x135
  
// OR use this initializer (uncomment) if using a 1.47" 172x320 TFT:
//tft.init(172, 320);           // Init ST7789 172x320

// OR use this initializer (uncomment) if using a 1.9" 170x320 TFT:
//tft.init(170, 320);           // Init ST7789 170x320
```

Comment out the first line, and uncomment the line that corresponds to this display, so it looks like:

```cpp
// Use this initializer (uncomment) if using a 1.3" or 1.54" 240x240 TFT:
//tft.init(240, 240);           // Init ST7789 240x240

// OR use this initializer (uncomment) if using a 1.69" 280x240 TFT:
//tft.init(240, 280);           // Init ST7789 280x240

// OR use this initializer (uncomment) if using a 2.0" 320x240 TFT:
//tft.init(240, 320);           // Init ST7789 320x240

// OR use this initializer (uncomment) if using a 1.14" 240x135 TFT:
//tft.init(135, 240);           // Init ST7789 240x135
  
// OR use this initializer (uncomment) if using a 1.47" 172x320 TFT:
tft.init(172, 320);           // Init ST7789 172x320

// OR use this initializer (uncomment) if using a 1.9" 170x320 TFT:
//tft.init(170, 320);           // Init ST7789 170x320
```

Now upload the sketch to your Arduino. You may need to press the Reset button to reset the arduino and TFT. You should see a collection of graphical tests draw out on the TFT.

![](https://cdn-learn.adafruit.com/assets/assets/000/110/304/medium800thumb/adafruit_products_5393-10.jpg?1648502583)

# Changing Pins

Now that you have it working, there's a few things you can do to change around the pins.

If you're using Hardware SPI, the CLOCK and MOSI pins are 'fixed' and can't be changed. But you can change to software SPI, which is a bit slower, and that lets you pick any pins you like. Find these lines:

```auto
// OPTION 1 (recommended) is to use the HARDWARE SPI pins, which are unique
// to each board and not reassignable. For Arduino Uno: MOSI = pin 11 and
// SCLK = pin 13. This is the fastest mode of operation and is required if
// using the breakout board's microSD card.

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

// OPTION 2 lets you interface the display using ANY TWO or THREE PINS,
// tradeoff being that performance is not as fast as hardware SPI above.
//#define TFT_MOSI 11  // Data out
//#define TFT_SCLK 13  // Clock out

//Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
```

Comment out option 1, and uncomment option 2. Then you can change the pin names that begin with **TFT\_** to whatever pins you'd like!

The 7789-based TFT displays have an auto-reset circuit on it, so you probably don't need to use the **RST&nbsp;** pin. You can change

`#define TFT_RST    9`

to

`#define TFT_RST   -1`

so that pin isn't used either. Or connect it up for manual TFT resetting!

# Adafruit 1.47" Round Rectangle TFT Display

## Adafruit GFX library

![](https://cdn-learn.adafruit.com/assets/assets/000/019/543/medium800/adafruit_products_128x128_top_display_07_ORIG.jpg?1409937908)

The Adafruit\_GFX library for Arduino provides a common syntax and set of graphics functions for all of our TFT, LCD and OLED displays. This allows Arduino sketches to easily be adapted between display types with minimal fuss…and any new features, performance improvements and bug fixes will immediately apply across our complete offering of color displays.  
  
The GFX library is what lets you draw points, lines, rectangles, round-rects, triangles, text, etc.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/544/medium800/adafruit_products_128x128_top_display_08_ORIG.jpg?1409937941)

Check out our detailed tutorial here [http://learn.adafruit.com/adafruit-gfx-graphics-library](http://learn.adafruit.com/adafruit-gfx-graphics-library) It covers the latest and greatest of the GFX library!

# Adafruit 1.47" Round Rectangle TFT Display

## Drawing Bitmaps

There is a built-in microSD card slot into the breakout, and that may be used to load bitmap images! You will need a microSD card formatted **FAT16 or FAT32** (they almost always are by default).  
  
It's really easy to draw bitmaps! Start by downloading this image of ADABOT

![adabot.bmp](https://github.com/adafruit/Adafruit_ImageReader/raw/master/images/adabot320x172.bmp)

Rename the image to **adabot**. **bmp**.

You will want to download and 2 more images as well. Download and save the image below as **miniwoof.bmp**.

![miniwoof.bmp](https://github.com/adafruit/Adafruit_ImageReader/raw/master/images/miniwoof.bmp)

Download and save the image below as **wales.bmp**.

![wales.bmp](https://github.com/adafruit/Adafruit_ImageReader/raw/master/images/wales.bmp)

Copy all 3 images into the base directory of a microSD card and insert it into the microSD socket in the breakout. The contents of your SD card should look like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/110/031/medium800/st7789_drawing_bitmaps_Screen_Shot_2022-03-22_at_3.49.52_PM.png?1647989415)

Two more wires are required to interface with the onboard SD card:

- You'll need to connect up the **SO** pin to the SPI MISO line on your microcontroller. On Arduino Uno/Duemilanove/328-based, that's **Digital 12**. On a Mega, it's **Digital 50** and on Leonardo/Due it's **ICSP-1** ([See SPI Connections for more details](http://arduino.cc/en/Reference/SPI))
- Also, the **CCS** &nbsp;or **CC** pin to **Digital 4** on your Arduino as well. You can change this pin later, but stick with this for now.

![](https://cdn-learn.adafruit.com/assets/assets/000/110/192/medium800/adafruit_products_1.47_Drawing_Bitmaps_bb.jpg?1648226892)

You may want to try the **SD library** examples before continuing, especially one that lists all the files on the SD card

Open the&nbsp; **File→examples→Adafruit ImageReader Library→**** BreakoutST7789 - 172x320**&nbsp;example:

![](https://cdn-learn.adafruit.com/assets/assets/000/110/205/medium800/adafruit_products_Screen_Shot_2022-03-25_at_10.41.59_AM.png?1648230349)

Now upload the&nbsp;example sketch to the Arduino. You should see ADABOT appear! If you have any problems, check the serial console for any messages such as not being able to initialize the microSD card or not finding the image.

![](https://cdn-learn.adafruit.com/assets/assets/000/110/206/medium800/adafruit_products_IMG_4033.jpeg?1648231631)

To make new bitmaps, make sure they are no bigger than the display size in pixels and save them in **24-bit BMP format**! They must be in 24-bit format, even if they are not 24-bit color as that is the easiest format for the Arduino. You can rotate images using the `setRotation()` procedure  
  
You can draw as many images as you want - don't forget the names must be less than 8 characters long. Just copy the BMP drawing routines below `loop()` and call

> `bmpDraw(bmpfilename, x, y); `

For each bitmap.

They can be smaller than **320x172** and placed in any location on the screen.

# Adafruit 1.47" Round Rectangle TFT Display

## CircuitPython Usage

You will need a board capable of running CircuitPython, such as the Adafruit Metro M4 Express. You can also use boards such as the Adafruit Feather M4 Express. Adafruit recommends using at least an M4 processor because they are much faster and works better for driving a display.

This guide will be using a Feather M4 Express. The steps should be about the same for the Metro. If you haven't already, be sure to check out the [Feather M4 Express](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/assembly)&nbsp;guide.

### Adafruit Feather M4 Express - Featuring ATSAMD51

[Adafruit Feather M4 Express - Featuring ATSAMD51](https://www.adafruit.com/product/3857)
It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox, half bird, OK?) This feather is powered by our new favorite chip, the **ATSAMD51J19** -&nbsp; with...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3857)
[Related Guides to the Product](https://learn.adafruit.com/products/3857/guides)
![Angled shot of a Adafruit Feather M4 Express. ](https://cdn-shop.adafruit.com/640x480/3857-10.jpg)

## Preparing the Breakout

Before using the TFT Breakout, you will need to solder the headers or some wires to it. Be sure to check out the&nbsp;[Adafruit Guide To Excellent Soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering).&nbsp;After that the breakout should be ready to go.

## Feather Wiring
- **Vin** &nbsp;connects to the Feather's&nbsp; **3V** &nbsp;pin
- **GND** &nbsp;connects to the Feather's&nbsp; **Gnd** &nbsp;pin
- **CLK** &nbsp;connects to SPI clock. On the Feather, that's&nbsp; **SCK**
- **MOSI** &nbsp;connects to SPI MOSI. On the Feather, that's also&nbsp; **MO**
- **CS** connects to our SPI Chip Select pin. This uses **D5**
- **RST** connects to the Reset pin. This uses **D9**.
- **DC** connects to our SPI Chip Select pin. This uses **D6**.

![adafruit_products_1.47_CircuitPython_Feather_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/207/medium640/adafruit_products_1.47_CircuitPython_Feather_bb.jpg?1648233256)

## Metro M4 Wiring
- **Vin** &nbsp;connects to the Metro's&nbsp; **5**** V **&nbsp;or&nbsp;** 3.3**&nbsp;pin.
- **GND** &nbsp;connects to any one of the Metro's&nbsp; **Gnd** &nbsp;pins.
- **CLK** &nbsp;connects to SPI clock. On the Metro, that's&nbsp; **Pin 3** &nbsp;on the ICSP Header.
- **MOSI** &nbsp;connects to SPI MOSI. On the Metro, that's&nbsp; **Pin 4** &nbsp;on the ISCP Header.
- **CS** &nbsp;connects to our SPI Chip Select pin. We'll be using&nbsp; **D5**
- **RST** &nbsp;connects to our Reset pin. We'll be using&nbsp; **D9**.
- **DC** &nbsp;connects to our SPI Chip Select pin. We'll be using&nbsp; **D6**.

![adafruit_products_1.47_CircuitPython_Metro_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/209/medium640/adafruit_products_1.47_CircuitPython_Metro_bb.jpg?1648233371)

## CircuitPython Library Installation

First, make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython)&nbsp;for your board.

Next you'll need to install the&nbsp;[Adafruit CircuitPython ST7789](https://github.com/adafruit/Adafruit_CircuitPython_ST7789)&nbsp;library on your CircuitPython board.&nbsp;&nbsp;

Click the&nbsp; **Download Project Bundle** &nbsp;button below to download the necessary libraries and the&nbsp; **code.py** &nbsp;file in a zip file. Extract the contents of the zip file, open the folder that matches your CircuitPython version, and copy the&nbsp; **entire&nbsp;**** lib **&nbsp;** folder **&nbsp;and the&nbsp;** code.py **&nbsp;file to your&nbsp;** CIRCUITPY**&nbsp;drive.

https://github.com/adafruit/Adafruit_CircuitPython_ST7789/blob/main/examples/st7789_172x320_1.47_simpletest.py

## Run the Script

Once everything is wired up correctly and the files are all copied over, the script should automatically run. If not, try pressing the reset button and you should see the following on the display:

![](https://cdn-learn.adafruit.com/assets/assets/000/110/210/medium800/adafruit_products_IMG_4036.jpeg?1648234976)

# Adafruit 1.47" Round Rectangle TFT Display

## Python Usage

It's easy to use display breakouts with Python and the&nbsp;[Adafruit Blinka Displayio](https://github.com/adafruit/Adafruit_Blinka_Displayio)&nbsp;module. This module allows you to easily write Python code to control the display.

Below covers how to wire the display to a Raspberry Pi.&nbsp;

Since there's&nbsp;_dozens_&nbsp;of Linux computers/boards you can use, below shows wiring for Raspberry Pi. For other platforms,&nbsp;[please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Connect the display as shown below to your Raspberry Pi.

Info: 

Warning: 

# Wiring
- **Vin** &nbsp;connects to the Raspberry Pi's&nbsp; **3V** &nbsp;pin
- **GND** &nbsp;connects to the Raspberry Pi's&nbsp; **ground**
- **CLK** &nbsp;connects to SPI clock. On the Raspberry Pi, that's&nbsp; **SLCK**
- **MOSI** &nbsp;connects to SPI MOSI. On the Raspberry Pi, that's also&nbsp; **MOSI**
- **CS** connects to our SPI Chip Select pin. This uses **CE0**
- **RST** connects to our Reset pin. This uses **GPIO 24,** &nbsp;but it can be changed later.
- **D/C** &nbsp;connects to our SPI Chip Select pin. This uses&nbsp; **GPIO 25** , but it can be changed later as well.

![adafruit_products_1.47_Python_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/217/medium640/adafruit_products_1.47_Python_bb.jpg?1648243050)

# 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](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Warning: 

## Python Installation of ST7789 Library

Once that's done, from your command line run the following command:

```terminal
sudo pip3 install adafruit-circuitpython-st7789 adafruit-circuitpython-display-text
```

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:

```terminal
sudo apt-get install python3-pip
```

## Pillow Library

PIL, the Python Imaging Library, will also be needed to display 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:

```terminal
sudo apt-get install python3-pil
```

## NumPy Library

You can install NumPy which allows for additional speed. This can be installed with the following command:

```terminal
sudo apt-get install python3-numpy
```

## Running the Code

Next to run the code, you will need to do a simple modification so the CircuitPython code runs on Python.

### Script Download and Modifications

Download the script using the wget command:

```terminal
cd ~
wget https://github.com/adafruit/Adafruit_CircuitPython_ST7789/raw/main/examples/st7789_172x320_1.47_simpletest.py
```

Next, edit the script and make the following changes to use the correct pins:

```python
tft_cs = board.CE0
tft_dc = board.D25
tft_rst = board.D24
```

Now go ahead and run the script, the output should look like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/110/224/medium800/adafruit_products_IMG_4040.jpeg?1648252234)

### Full Example
https://github.com/adafruit/Adafruit_CircuitPython_ST7789/blob/main/examples/st7789_172x320_1.47_simpletest.py

## Python Installation of RGB Display Library

The other library that you can use to draw to displays in Python is the RGB Display library. This library allows you to more directly use PIL so if you wanted to draw a JPG image, for instance, or other advanced graphics, then you can easily do so. To install the library, run this command:

```terminal
sudo pip3 install adafruit-circuitpython-rgb-display
```

### Displaying a JPG Image

To display an image other than a Bitmap such as a JPG, you just need to load it in with Pillow. To demonstrate this, download this image of blinka:

![](https://cdn-learn.adafruit.com/assets/assets/000/110/219/medium800/adafruit_products_blinka.jpg?1648244099)

You can download it straight onto you Pi with this command:

```terminal
wget https://cdn-learn.adafruit.com/assets/assets/000/110/219/original/adafruit_products_blinka.jpg
mv adafruit_products_blinka.jpg blinka.jpg
```

You can download the script to your Pi with this command:

```terminal
wget https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/raw/main/examples/rgb_display_pillow_image.py
```

### Run the Script

You will need to modify the script by commenting out a few lines of the ILI9341 display initializer. Leave everything else that including the line that contains `cs=cs_pin,` alone. The code with the commented out part should look like this:

```python
#disp = ili9341.ILI9341(
#    spi,
#    rotation=90,  # 2.2", 2.4", 2.8", 3.2" ILI9341
    cs=cs_pin,
    dc=dc_pin,
```

Then you will need to uncomment the line that for this display:

```python
disp = st7789.ST7789(spi, rotation=90, width=172, height=320, x_offset=34, # 1.47" ST7789
```

Now you can run the script with this command:

```terminal
sudo python3 rgb_display_pillow_image.py
```

Your display should look like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/110/225/medium800/adafruit_products_IMG_4041.jpeg?1648252258)

### Full Example
https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/blob/main/examples/rgb_display_pillow_image.py

# Adafruit 1.47" Round Rectangle TFT Display

## Downloads

## Files

- [ST7789VW datasheet](https://cdn-learn.adafruit.com/assets/assets/000/082/882/original/ST7789VW_SPEC_V1.0.pdf?1571860977)
- [EagleCAD PCB Files on GitHub](https://github.com/adafruit/Adafruit-1.47in-320x172-Round-Rectangle-TFT-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%201.47in%20320x172%20Round%20Rectangle%20TFT.fzpz)

# Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/110/296/medium800/adafruit_products_Schematic.png?1648501249)

![](https://cdn-learn.adafruit.com/assets/assets/000/110/297/medium800/adafruit_products_Fab_Print.png?1648501264)


## Primary Products

### Adafruit 1.47" 320x172 Round Rectangle Color IPS TFT Display

[Adafruit 1.47" 320x172 Round Rectangle Color IPS TFT Display](https://www.adafruit.com/product/5393)
Don't be such a _square_ - throw a curveball into your electronics with a curved-edge miniature display. Here's a new "round rect" TFT display&nbsp;- it's 1.47" diagonal and has high-density 250 ppi, 172x320 full-color pixels with IPS any-angle viewing....

In Stock
[Buy Now](https://www.adafruit.com/product/5393)
[Related Guides to the Product](https://learn.adafruit.com/products/5393/guides)

## Related Guides

- [Mini GIF Players](https://learn.adafruit.com/mini-gif-players.md)
- [Open Sesame! A SMS-controlled door lock](https://learn.adafruit.com/open-sesame-a-sms-controlled-door-lock.md)
- [Adafruit AS7343 14-Channel Light / Color Sensor Breakout](https://learn.adafruit.com/adafruit-as7343-14-channel-light-color-sensor-breakout.md)
- [HalloWing Googly Eye](https://learn.adafruit.com/hallowing-googly-eye.md)
- [Adafruit LIS2MDL Triple Axis Magnetometer](https://learn.adafruit.com/adafruit-lis2mdl-triple-axis-magnetometer.md)
- [Add MONSTER M4SK to your Costume Mask](https://learn.adafruit.com/add-monster-m4sk-to-your-costume-mask.md)
- [Adafruit Bluefruit LE Shield](https://learn.adafruit.com/adafruit-bluefruit-le-shield.md)
- [CircuitPython Display_Text Library](https://learn.adafruit.com/circuitpython-display-text-library.md)
- [Build an ML Rock Paper Scissors Game with Lobe](https://learn.adafruit.com/lobe-rock-paper-scissors.md)
- [Adafruit 1.69" 280x240 Round Rectangle Color IPS TFT Display](https://learn.adafruit.com/adafruit-1-69-280x240-round-rectangle-color-ips-tft-display.md)
- [Introducing Adafruit Trellis ](https://learn.adafruit.com/adafruit-trellis-diy-open-source-led-keypad.md)
- [PixelDust Digital Sand Demos for Arcada](https://learn.adafruit.com/pixeldust-digital-sand-demos-for-arcada.md)
- [DIY WiFi Raspberry Pi Touchscreen Camera](https://learn.adafruit.com/diy-wifi-raspberry-pi-touch-cam.md)
- [ Memory-saving tips for CircuitPython](https://learn.adafruit.com/memory-saving-tips-for-circuitpython.md)
- [Tile-Matching Game on the Fruit Jam and Metro RP2350](https://learn.adafruit.com/tile-matching-game-on-the-adafruit-metro-rp2350.md)
