# CircuitPython displayio Setup for TFT FeatherWings

## Overview

Have you been wondering what displayio is and don't know where to get started? Well, look no further. In this guide we show you how to get displayio up and running on our TFT FeatherWings. We currently offer a few different selections that all have drivers for CircuitPython.

![](https://cdn-learn.adafruit.com/assets/assets/000/075/014/medium800/circuitpython_3-displays.png?1556323630)

# What is displayio?

Displayio is a CircuitPython module that handles drawing to the display from within CircuitPython itself. It has been generally available for most displays since version 4.0 Beta 4. At this point there are displayio drivers available for most of our color displays. Getting started with displayio is very easy. You just need CircuitPython version 4.0 or higher loaded on your CircuitPython board and the appropriate display driver. Since the FeatherWings are the easiest TFT displays to connect we will cover those in this guide.

# CircuitPython displayio Setup for TFT FeatherWings

## 2.4" TFT FeatherWing

We'll start with the 2.4" TFT FeatherWing which has an ILI9341 display on it. If you would like more information on this display, be sure to check out our&nbsp;[Adafruit 2.4" TFT FeatherWing guide](https://learn.adafruit.com/adafruit-2-4-tft-touch-screen-featherwing).

# Parts

To use this display with displayio, you will only need two main parts. First, you will need the TFT FeatherWing itself.

### TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers

[TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers](https://www.adafruit.com/product/3315)
A Feather board without ambition is a Feather board without FeatherWings! Spice up your Feather project with a beautiful 2.4" touchscreen display shield with built in microSD card socket. This TFT display is 2.4" diagonal with a bright 4 white-LED backlight. You get&nbsp; 240x320...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3315)
[Related Guides to the Product](https://learn.adafruit.com/products/3315/guides)
![View of a TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers. A polished finger drawing a heart on the touch screen. ](https://cdn-shop.adafruit.com/product-videos/640x480/3315-09.jpg)

And second, you will need a Feather such as the Feather M0 Express or the Feather M4 Express. We recommend the Feather M4 Express because it's much faster and works better for driving a display.

### 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...

In 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)

For this guide, we'll assume you have a Feather M4 Express. The steps should be about the same for the Feather M0 Express. To start, if you haven't already done so, follow the assembly instructions for the Feather M4 Express in our&nbsp;[Feather M4 Express guide](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/assembly). We'll start by looking at the back of the 2.4" TFT FeatherWing.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/075/015/medium800/circuitpython_2.4-reverse.png?1556331491)

After that, it's just a matter of inserting the Feather M4 Express into the back of the TFT FeatherWing.

![](https://cdn-learn.adafruit.com/assets/assets/000/075/016/medium800/circuitpython_2.4-assembled.png?1556331529)

# Required CircuitPython Libraries

To use this display with `displayio`, there is only one required library.

[Adafruit_CircuitPython_ILI9341](https://github.com/adafruit/Adafruit_CircuitPython_ILI9341/releases)
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 necessary libraries&nbsp;to use the hardware--carefully follow the steps to find and install these libraries from&nbsp;[Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).&nbsp; Our introduction guide has&nbsp;[a great page on how to install the library bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries)&nbsp;for both express and non-express boards.

Remember for non-express boards, you'll need to manually install the necessary libraries from the bundle:

- **adafruit\_ili9341**

Before continuing make sure your board's lib folder or root filesystem has the&nbsp; **adafruit\_ili9341** &nbsp;file copied over.

## Code Example Additional Libraries

For the Code Example, you will need an additional library. We decided to make use of a library so the code didn't get overly complicated.

[Adafruit_CircuitPython_Display_Text](https://github.com/adafruit/Adafruit_CircuitPython_Display_Text)
Go ahead and install this in the same manner as the driver library by copying the&nbsp; **adafruit\_display\_text** folder over to the **lib** folder on your CircuitPython device.

# CircuitPython Code Example
https://github.com/adafruit/Adafruit_CircuitPython_ILI9341/blob/main/examples/ili9341_simpletest.py

## Code Details

Let's take a look at the sections of code one by one.&nbsp;We start by importing the board so that we can initialize `SPI`, `displayio`, `terminalio` for the font, a `label`, and the `adafruit_ili9341`&nbsp;driver.

```auto
import board
import displayio
import fourwire
import terminalio
from adafruit_display_text import label
import adafruit_ili9341
```

Next we release any previously used displays. This is important because if the Feather is reset, the display pins are not automatically released and this makes them available for use again.

```auto
displayio.release_displays()
```

Next, we set the SPI object to the board's SPI with the easy shortcut function `board.SPI()`. By using this function, it finds the SPI module and initializes using the default SPI parameters. Next we set the Chip Select and Data/Command pins that will be used.

```auto
spi = board.SPI()
tft_cs = board.D9
tft_dc = board.D10
```

In the next line, we set the display bus to FourWire which makes use of the SPI bus. The reset parameter is actually not needed for the FeatherWing, but was added to make it compatible with the breakout displays. You can either leave it or remove it if you need access to an additional GPIO pin.

```auto
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D6)
```

Finally, we initialize the driver with a width of 320 and a height of 240. If we stopped at this point and ran the code, we would have a terminal that we could type at and have the screen update.

```auto
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/075/034/medium800/circuitpython_2.4-terminal.png?1556510158)

Next we create a background splash image. We do this by creating a group that we can add elements to and adding that group to the display. The display will automatically handle updating the group.

```auto
splash = displayio.Group()
display.root_group = splash
```

Next we create a Bitmap which is like a canvas that we can draw on. In this case we are creating the Bitmap to be the same size as the screen, but only have one color. The Bitmaps can currently handle up to 256 different colors. We create a Palette with one color and set that color to 0x00FF00 which happens to be green. Colors are Hexadecimal values in the format of RRGGBB. Even though the Bitmaps can only handle 256 colors at a time, you get to define what those 256 different colors are.

```auto
color_bitmap = displayio.Bitmap(320, 240, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x00FF00 # Bright Green
```

With all those pieces in place, we create a TileGrid by passing the bitmap and palette and draw it at `(0, 0)` which represents the display's upper left.

```auto
bg_sprite = displayio.TileGrid(color_bitmap,
                               pixel_shader=color_palette,
                               x=0, y=0)
splash.append(bg_sprite)
```

This creates a solid green background which we will draw on top of.

![](https://cdn-learn.adafruit.com/assets/assets/000/078/928/medium800/circuitpython_2.4-green.png?1564765013)

Next we will create a smaller purple rectangle. The easiest way to do this is the create a new bitmap that is a little smaller than the full screen with a single color and place it in a specific location. In this case we will create a bitmap that is 20 pixels smaller on each side. The screen is 320x240, so we'll want to subtract 40 from each of those numbers.

We'll also want to place it at the position&nbsp;`(20, 20)` so that it ends up centered.

```auto
inner_bitmap = displayio.Bitmap(280, 200, 1)
inner_palette = displayio.Palette(1)
inner_palette[0] = 0xAA0088 # Purple
inner_sprite = displayio.TileGrid(inner_bitmap,
                                  pixel_shader=inner_palette,
                                  x=20, y=20)
splash.append(inner_sprite)
```

Since we are adding this after the first rectangle, it's automatically drawn on top. Here's what it looks like now.

![](https://cdn-learn.adafruit.com/assets/assets/000/078/929/medium800/circuitpython_2.4-green-purple.png?1564765446)

Next let's add a label that says "Hello World!" on top of that. We're going to use the built-in Terminal Font and scale it up by a factor of three. To scale the label only, we will make use of a subgroup, which we will then add to the main group.

Labels are centered vertically, so we'll place it at 120 for the Y coordinate, and around 57 pixels make it appear to be centered horizontally, but if you want to change the text, change this to whatever looks good to you. Let's go with some yellow text, so we'll pass it a value of `0xFFFF00`.

```python
text_group = displayio.Group(scale=3, x=57, y=120)
text = "Hello World!"
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00)
text_group.append(text_area) # Subgroup for text scaling
splash.append(text_group)
```

Finally, we place an infinite loop at the end so that the graphics screen remains in place and isn't replaced by a terminal.

```auto
while True:
    pass
```

![](https://cdn-learn.adafruit.com/assets/assets/000/078/930/medium800/circuitpython_2.4-hello-world.png?1564765810)

## Using Touch

We won't be covering how to use the touchscreen on the shield with CircuitPython in this guide, but the library required for enabling resistive touch is the&nbsp;[Adafruit\_CircuitPython\_STMPE610](https://github.com/adafruit/Adafruit_CircuitPython_STMPE610) library.

# Where to go from here

Be sure to check out this excellent&nbsp;[guide to CircuitPython Display Support Using displayio](https://learn.adafruit.com/circuitpython-display-support-using-displayio)

# CircuitPython displayio Setup for TFT FeatherWings

## 3.5" TFT FeatherWing

The steps to get the 3.5" TFT FeatherWing, which has an HX8357 display on it, are very similar to the 2.4" TFT FeatherWing. If you would like more information on this display, be sure to check out our&nbsp;[Adafruit 3.5" TFT FeatherWing guide](https://learn.adafruit.com/adafruit-3-5-tft-featherwing).

# Parts

To use this display with displayio, you will only need two main parts. First, you will need the TFT FeatherWing itself. One thing to note with this display is because of the increased resolution, updates will be a little slower for this display than for the other displays.

### Adafruit TFT FeatherWing - 3.5" 480x320 Touchscreen for Feathers

[Adafruit TFT FeatherWing - 3.5" 480x320 Touchscreen for Feathers](https://www.adafruit.com/product/3651)
Spice up your Feather project with a beautiful 3.5" touchscreen display shield with built in microSD card socket. This TFT display is 3.5" diagonal with a bright 6 white-LED backlight. You get a massive 480x320 pixels with individual 16-bit color pixel control. It has way more...

In Stock
[Buy Now](https://www.adafruit.com/product/3651)
[Related Guides to the Product](https://learn.adafruit.com/products/3651/guides)
![Overhead shot of a Black woman's hands with a blue and pinkish-red manicure drawing a heart on a touchscreen breakout.](https://cdn-shop.adafruit.com/640x480/3651-05.jpg)

And second, you will need a Feather such as theFeather M0 Express or the Feather M4 Express. We recommend the Feather M4 Express because it's much faster and works better for driving a display.

### 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...

In 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)

For this guide, we'll assume you have a Feather M4 Express. The steps should be about the same for the Feather M0 Express. To start, if you haven't already done so, follow the assembly instructions for the Feather M4 Express in our&nbsp;[Feather M4 Express guide](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/assembly). We'll start by looking at the back of the 3.5" TFT FeatherWing.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/075/032/medium800/circuitpython_3.5-reverse.png?1556509731)

After that, it's just a matter of inserting the Feather M4 Express into the back of the TFT FeatherWing.

![](https://cdn-learn.adafruit.com/assets/assets/000/075/033/medium800/circuitpython_3.5-assembled.png?1556509770)

# Required CircuitPython Libraries

To use this display with `displayio`, there is only one required library.

[Adafruit_CircuitPython_HX8357](https://github.com/adafruit/Adafruit_CircuitPython_HX8357/releases)
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 necessary libraries&nbsp;to use the hardware--carefully follow the steps to find and install these libraries from&nbsp;[Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).&nbsp; Our introduction guide has&nbsp;[a great page on how to install the library bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries)&nbsp;for both express and non-express boards.

Remember for non-express boards, you'll need to manually install the necessary libraries from the bundle:

- **adafruit\_hx8357**

Before continuing make sure your board's lib folder or root filesystem has the&nbsp; **adafruit\_hx8357** &nbsp;file copied over.

## Code Example Additional Libraries

For the Code Example, you will need an additional library. We decided to make use of a library so the code didn't get overly complicated.

[Adafruit_CircuitPython_Display_Text](https://github.com/adafruit/Adafruit_CircuitPython_Display_Text)
Go ahead and install this in the same manner as the driver library by copying the&nbsp; **adafruit\_display\_text** folder over to the **lib** folder on your CircuitPython device.

# CircuitPython Code Example
https://github.com/adafruit/Adafruit_CircuitPython_HX8357/blob/main/examples/hx8357_simpletest.py

Let's take a look at the sections of code one by one.&nbsp;We start by importing the board so that we can initialize `SPI`, `displayio`, `terminalio` for the font, a `label`, and the `adafruit_hx8357`&nbsp;driver.

```auto
import board
import displayio
import terminalio
from adafruit_display_text import label
from adafruit_hx8357 import HX8357
```

Next we release any previously used displays. This is important because if the Feather is reset, the display pins are not automatically released and this makes them available for use again.

```auto
displayio.release_displays()
```

Next, we set the SPI object to the board's SPI with the easy shortcut function `board.SPI()`. By using this function, it finds the SPI module and initializes using the default SPI parameters. Next we set the Chip Select and Data/Command pins that will be used.

```auto
spi = board.SPI()
tft_cs = board.D9
tft_dc = board.D10
```

In the next line, we set the display bus to FourWire which makes use of the SPI bus.

```auto
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
```

Finally, we initialize the driver with a width of 480 and a height of 320. If we stopped at this point and ran the code, we would have a terminal that we could type at and have the screen update.

```auto
display = HX8357(display_bus, width=480, height=320)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/075/037/medium800/circuitpython_3.5-terminal.png?1556511521)

Next we create a background splash image. We do this by creating a group that we can add elements to and adding that group to the display. The display will automatically handle updating the group.

```auto
splash = displayio.Group()
display.show(splash)
```

After that we create a Bitmap which is like a canvas that we can draw on. In this case we are creating the Bitmap to be the same size as the screen, but only have one color. The Bitmaps can currently handle up to 256 different colors. We create a Palette with one color and set that color to 0x00FF00 which happens to be green. Colors are Hexadecimal values in the format of RRGGBB. Even though the Bitmaps can only handle 256 colors at a time, you get to define what those 256 different colors are.

```auto
color_bitmap = displayio.Bitmap(480, 320, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x00FF00 # Bright Green
```

With all those pieces in place, we create a TileGrid by passing the bitmap and palette and draw it at `(0, 0)` which represents the display's upper left.

```auto
bg_sprite = displayio.TileGrid(color_bitmap,
                               pixel_shader=color_palette,
                               x=0, y=0)
splash.append(bg_sprite)
```

This creates a solid green background which we will draw on top of.

![](https://cdn-learn.adafruit.com/assets/assets/000/079/142/medium800/circuitpython_3.5-green.jpg?1565135041)

Next we will create a smaller purple rectangle. The easiest way to do this is the create a new bitmap that is a little smaller than the full screen with a single color and place it in a specific location. In this case we will create a bitmap that is 20 pixels smaller on each side. The screen is 480x320, so we'll want to subtract 40 from each of those numbers.

We'll also want to place it at the position&nbsp;`(20, 20)` so that it ends up centered.

```auto
# Draw a smaller inner rectangle
inner_bitmap = displayio.Bitmap(440, 280, 1)
inner_palette = displayio.Palette(1)
inner_palette[0] = 0xAA0088 # Purple
inner_sprite = displayio.TileGrid(inner_bitmap,
                                  pixel_shader=inner_palette,
                                  x=20, y=20)
splash.append(inner_sprite)
```

Since we are adding this after the first rectangle, it's automatically drawn on top. Here's what it looks like now.

![](https://cdn-learn.adafruit.com/assets/assets/000/079/143/medium800/circuitpython_3.5-green-purple.jpg?1565135072)

Next let's add a label that says "Hello World!" on top of that. We're going to use the built-in Terminal Font and scale it up by a factor of three. To scale the label only, we will make use of a subgroup, which we will then add to the main group.

Labels are centered vertically, so we'll place it at 160 for the Y coordinate, and around 137 pixels make it appear to be centered horizontally, but if you want to change the text, change this to whatever looks good to you. Let's go with some yellow text, so we'll pass it a value of `0xFFFF00`.

```auto
# Draw a label
text_group = displayio.Group(scale=3, x=137, y=160)
text = "Hello World!"
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00)
text_group.append(text_area) # Subgroup for text scaling
splash.append(text_group)
```

Finally, we place an infinite loop at the end so that the graphics screen remains in place and isn't replaced by a terminal.

![](https://cdn-learn.adafruit.com/assets/assets/000/079/144/medium800/circuitpython_3.5-hello-world.jpg?1565135110)

```auto
while True:
    pass
```

## Using Touch

We won't be covering how to use the touchscreen on the shield with CircuitPython in this guide, but the library required for enabling resistive touch is the&nbsp;[Adafruit\_CircuitPython\_STMPE610](https://github.com/adafruit/Adafruit_CircuitPython_STMPE610) library.

# Where to go from here

Be sure to check out this excellent&nbsp;[guide to CircuitPython Display Support Using displayio](https://learn.adafruit.com/circuitpython-display-support-using-displayio)

# CircuitPython displayio Setup for TFT FeatherWings

## Mini Color TFT with Joystick FeatherWing

The Mini Color TFT with Joystick FeatherWing is a fun piece of hardware. In addition to a miniature TFT display, it also has a Joystick and two buttons. This could be used to make a miniature gaming system, MP3 Player and much more. If you would like more information on this display, be sure to check out our&nbsp;[Adafruit Mini TFT with Joystick FeatherWing guide](https://learn.adafruit.com/adafruit-mini-tft-featherwing). To use this display with displayio, you will need at least two main parts. First, you will need the TFT FeatherWing itself.

### Adafruit Mini Color TFT with Joystick FeatherWing

[Adafruit Mini Color TFT with Joystick FeatherWing](https://www.adafruit.com/product/3321)
Add a dazzling color display to your Feather project with this&nbsp; **Adafruit Mini Color TFT with Joystick FeatherWing**.

It has so much stuff going on, we could not fit any more parts on the PCB! There's a **0.96" 160x80 Color TFT Display** with...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3321)
[Related Guides to the Product](https://learn.adafruit.com/products/3321/guides)
![Angled shot of a Adafruit Mini Color TFT with Joystick FeatherWing on a small white breadboard connected to a lithium battery. ](https://cdn-shop.adafruit.com/640x480/3321-06.jpg)

And second, you will need a Feather such as theFeather M0 Express or the Feather M4 Express. We recommend the Feather M4 Express because it's much faster and works better for driving a display.

### 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...

In 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)

To connect the two, you have several options. One of the easiest ways is with the Doubler or Tripler which allows you to insert both items side-by-side. You can find out more about these including assembly information in our&nbsp;[FeatherWing Proto, Doubler and Tripler guide](https://learn.adafruit.com/featherwing-proto-and-doubler). If you do decide to go with the doubler, be aware that it comes with one set of female headers and one of the set of stacking header, so you may want to order an extra set of female headers with it or you could just trim off the extra pins with some flush cutters.

### FeatherWing Doubler - Prototyping Add-on For All Feather Boards

[FeatherWing Doubler - Prototyping Add-on For All Feather Boards](https://www.adafruit.com/product/2890)
This is the **FeatherWing Doubler** - a prototyping add-on and more for all Feather boards. This is similar to our [FeatherWing Proto](https://www.adafruit.com/products/2884) except there are two! The magic of the Doubler comes when stacking a Feather and another...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2890)
[Related Guides to the Product](https://learn.adafruit.com/products/2890/guides)
![Double prototyping feather wing PCB with socket headers installed](https://cdn-shop.adafruit.com/640x480/2890-01.jpg)

### Header Kit for Feather - 12-pin and 16-pin Female Header Set

[Header Kit for Feather - 12-pin and 16-pin Female Header Set](https://www.adafruit.com/product/2886)
These two&nbsp; **Female&nbsp;Headers** &nbsp;alone are, well, lonely. But pair them with any of our&nbsp;[Feather](https://www.adafruit.com/categories/777)&nbsp;boards and you're in business!

What do they do? They get soldered on either side of the Feather...

In Stock
[Buy Now](https://www.adafruit.com/product/2886)
[Related Guides to the Product](https://learn.adafruit.com/products/2886/guides)
![Angled shot of a Header Kit for Feather - 12-pin and 16-pin Female Header Set. ](https://cdn-shop.adafruit.com/640x480/2886-00.jpg)

And finally, if you would like to go with a small profile, you could just go with either a set of female headers or stacking headers.&nbsp;In this guide we decided to just use a doubler with the extra female headers. Let's start by assembling the pieces.

Start with the doubler facing up.

![circuitpython_minitft-assembly-1.png](https://cdn-learn.adafruit.com/assets/assets/000/075/077/medium640/circuitpython_minitft-assembly-1.png?1556603727)

Insert the Mini Color TFT with Joystick FeatherWing into the doubler.

![circuitpython_minitft-assembly-2.png](https://cdn-learn.adafruit.com/assets/assets/000/075/078/medium640/circuitpython_minitft-assembly-2.png?1556603782)

Insert the Feather into the doubler. You're done! Wasn't that easy?

![circuitpython_minitft-assembly-3.png](https://cdn-learn.adafruit.com/assets/assets/000/075/079/medium640/circuitpython_minitft-assembly-3.png?1556603832)

# Required CircuitPython Libraries

Since this is no ordinary display and has some additional controls, we have written a special module for out FeatherWing Helper library that not only initializes the display for us, it also initializes the joystick and buttons. You will need the following libraries.

[Adafruit_CircuitPython_ST7735R](https://github.com/adafruit/Adafruit_CircuitPython_ST7735R/releases)
[Adafruit_CircuitPython_FeatherWing](https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing/releases)
[Adafruit_CircuitPython_Seesaw](https://github.com/adafruit/Adafruit_CircuitPython_Seesaw/releases)
[Adafruit_CircuitPython_BusDevice](https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/releases)
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 necessary libraries&nbsp;to use the hardware--carefully follow the steps to find and install these libraries from&nbsp;[Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).&nbsp; Our introduction guide has&nbsp;[a great page on how to install the library bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries)&nbsp;for both express and non-express boards.

Remember for non-express boards, you'll need to manually install the necessary libraries from the bundle:

- **adafruit\_st7735r**
- **adafruit\_featherwing**
- **adafruit\_seesaw**
- **adafruit\_bus\_device**

Before continuing make sure your board's lib folder or root filesystem has the&nbsp; **adafruit\_st7735r** ,&nbsp; **adafruit\_featherwing** ,&nbsp; **adafruit\_seesaw&nbsp;** and&nbsp; **adafruit\_bus\_device** files and&nbsp;folders **&nbsp;** copied over.

# CircuitPython Code&nbsp;Example

Let's take a look at the simpletest for the FeatherWing library.

https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing/blob/main/examples/featherwing_minitft_simpletest.py

The first thing you might notice about this library is that compared to the other simpletests, it's quite small. Let's go through it a little at a time. First we start with the importing time so we can include a small delay at the end as well as the minitft\_featherwing library itself.

```auto
import time
from adafruit_featherwing import minitft_featherwing

```

Next we initialize the library and leave all the defaults. The FeatherWing allows you to change the DC and CS pins as well as change the address in case you have multiple displays. If you have changed either of these, you can pass the overriding values as parameters when initializing the library.

```auto
minitft = minitft_featherwing.MiniTFTFeatherWing()
```

In the main loop we save the current state of all the buttons into a variable called buttons. From there we check if each button is `True` and print out a message.

```auto
while True:
    buttons = minitft.buttons

    if buttons.right:
        print("Button RIGHT!")

    if buttons.down:
        print("Button DOWN!")

    if buttons.left:
        print("Button LEFT!")

    if buttons.up:
        print("Button UP!")

    if buttons.select:
        print("Button SELECT!")

    if buttons.a:
        print("Button A!")

    if buttons.b:
        print("Button B!")

    time.sleep(.001)
```

Go ahead and run the program and try pushing some of the buttons. It displays what you pushed right on the display.

![](https://cdn-learn.adafruit.com/assets/assets/000/075/114/medium800/circuitpython_minitft-running.png?1556679374)

# Where to go from here

Be sure to check out this excellent&nbsp;[guide to CircuitPython Display Support Using displayio](https://learn.adafruit.com/circuitpython-display-support-using-displayio)


## Featured Products

### Adafruit TFT FeatherWing - 3.5" 480x320 Touchscreen for Feathers

[Adafruit TFT FeatherWing - 3.5" 480x320 Touchscreen for Feathers](https://www.adafruit.com/product/3651)
Spice up your Feather project with a beautiful 3.5" touchscreen display shield with built in microSD card socket. This TFT display is 3.5" diagonal with a bright 6 white-LED backlight. You get a massive 480x320 pixels with individual 16-bit color pixel control. It has way more...

In Stock
[Buy Now](https://www.adafruit.com/product/3651)
[Related Guides to the Product](https://learn.adafruit.com/products/3651/guides)
### TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers

[TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers](https://www.adafruit.com/product/3315)
A Feather board without ambition is a Feather board without FeatherWings! Spice up your Feather project with a beautiful 2.4" touchscreen display shield with built in microSD card socket. This TFT display is 2.4" diagonal with a bright 4 white-LED backlight. You get&nbsp; 240x320...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3315)
[Related Guides to the Product](https://learn.adafruit.com/products/3315/guides)
### Adafruit Mini Color TFT with Joystick FeatherWing

[Adafruit Mini Color TFT with Joystick FeatherWing](https://www.adafruit.com/product/3321)
Add a dazzling color display to your Feather project with this&nbsp; **Adafruit Mini Color TFT with Joystick FeatherWing**.

It has so much stuff going on, we could not fit any more parts on the PCB! There's a **0.96" 160x80 Color TFT Display** with...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3321)
[Related Guides to the Product](https://learn.adafruit.com/products/3321/guides)
### 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...

In Stock
[Buy Now](https://www.adafruit.com/product/3857)
[Related Guides to the Product](https://learn.adafruit.com/products/3857/guides)
### Adafruit Feather M0 Express

[Adafruit Feather M0 Express](https://www.adafruit.com/product/3403)
At the Feather M0's heart is an ATSAMD21G18 ARM Cortex M0+ processor, clocked at 48 MHz and at 3.3V logic, the same one used in the new&nbsp;[Arduino Zero](https://www.adafruit.com/products/2843). This chip has a whopping 256K of FLASH (8x more than the Atmega328 or 32u4) and...

In Stock
[Buy Now](https://www.adafruit.com/product/3403)
[Related Guides to the Product](https://learn.adafruit.com/products/3403/guides)
### FeatherWing Tripler Mini Kit - Prototyping Add-on For Feathers

[FeatherWing Tripler Mini Kit - Prototyping Add-on For Feathers](https://www.adafruit.com/product/3417)
This is the **FeatherWing Tripler** - a prototyping add-on and more for all Feather boards. This is similar to our [FeatherWing Proto](https://www.adafruit.com/products/2884) except there are three! The magic of the Tripler comes when you want to connect your Feather to...

In Stock
[Buy Now](https://www.adafruit.com/product/3417)
[Related Guides to the Product](https://learn.adafruit.com/products/3417/guides)
### FeatherWing Doubler - Prototyping Add-on For All Feather Boards

[FeatherWing Doubler - Prototyping Add-on For All Feather Boards](https://www.adafruit.com/product/2890)
This is the **FeatherWing Doubler** - a prototyping add-on and more for all Feather boards. This is similar to our [FeatherWing Proto](https://www.adafruit.com/products/2884) except there are two! The magic of the Doubler comes when stacking a Feather and another...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2890)
[Related Guides to the Product](https://learn.adafruit.com/products/2890/guides)
### Stacking Headers for Feather - 12-pin and 16-pin female headers

[Stacking Headers for Feather - 12-pin and 16-pin female headers](https://www.adafruit.com/product/2830)
These two **Female Stacking Headers** alone are, well, lonely. But pair them with any of our [Feather](https://www.adafruit.com/categories/777) boards and you're in business!

What do they do? They stack. Put the headers through your Feather and then you can...

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

## Related Guides

- [Adafruit 2.4" TFT FeatherWing](https://learn.adafruit.com/adafruit-2-4-tft-touch-screen-featherwing.md)
- [Adafruit Feather M0 Express](https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-circuitpython.md)
- [Adafruit 3.5" 480x320 TFT FeatherWing](https://learn.adafruit.com/adafruit-3-5-tft-featherwing.md)
- [Adafruit Feather M4 Express](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51.md)
- [Adafruit Mini TFT with Joystick Featherwing](https://learn.adafruit.com/adafruit-mini-tft-featherwing.md)
- [Creating Custom Symbol Fonts for Adafruit GFX Library](https://learn.adafruit.com/creating-custom-symbol-font-for-adafruit-gfx-library.md)
- [Using Piezo Buzzers with CircuitPython & Arduino](https://learn.adafruit.com/using-piezo-buzzers-with-circuitpython-arduino.md)
- [STEMMA Lego base plates](https://learn.adafruit.com/stemma-lego-base-plates.md)
- [CircuitPython Basics: Digital Inputs & Outputs](https://learn.adafruit.com/circuitpython-digital-inputs-and-outputs.md)
- [How to train new TensorFlow Lite micro speech models](https://learn.adafruit.com/how-to-train-new-tensorflow-lite-micro-speech-models.md)
- [Adafruit MSA301 Triple Axis Accelerometer](https://learn.adafruit.com/msa301-triple-axis-accelerometer.md)
- [Adafruit NeoPXL8 FeatherWing and Library](https://learn.adafruit.com/adafruit-neopxl8-featherwing-and-library.md)
- [Adafruit CAN Bus FeatherWing](https://learn.adafruit.com/adafruit-can-bus-featherwing.md)
- [A Logger for CircuitPython](https://learn.adafruit.com/a-logger-for-circuitpython.md)
- [Creating and sharing a CircuitPython library](https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library.md)
- [Debugging the SAMD21 with GDB](https://learn.adafruit.com/debugging-the-samd21-with-gdb.md)
- [Program CircuitPython USB Devices with iPhone & iPad](https://learn.adafruit.com/use-circuitpython-devices-with-iphone-ipad.md)
- [Talking Musical NeoPixel Clock with Infrared, BLE and Touch Controls](https://learn.adafruit.com/talking-musical-neo-pixel-clock-with-infrared-ble-and-touch-controls.md)
- [Computer Space Mini Arcade](https://learn.adafruit.com/computer-space-mini-arcade.md)
- [MIDI Melody Maker](https://learn.adafruit.com/midi-melody-maker.md)
