# Running PyPortal Code on Blinka with Displayio

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/093/025/medium800/raspberry_pi_main_image.jpg?1594319753)

[Since the PyPortal came out](https://learn.adafruit.com/search?q=pyportal), there have been many examples written which take advantage of the [CircuitPython displayio graphics system](https://learn.adafruit.com/search?q=displayio). We have been working on writing a version of displayio that runs on Blinka, the CircuitPython compatibility layer for Python 3 on single board computers. With Blinka, you can run your favorite CircuitPython displayio applications and games on boards such as the Raspberry Pi or even the [FT232H](https://www.adafruit.com/product/2264).

To make things even easier, we also wrote a version of the PyPortal library that runs on Blinka to make it even easier to get up and running. The Raspberry Pi is already connected to the internet, so we decided to take advantage of this and removed much of the code that handled managing the connections and replaced it with the Linux equivalents.

The Blinka PyPortal library is a port of the original PyPortal library that is intended to be run in CPython.&nbsp; It leverages the Blinka Displayio library, which is a port of the original CircuitPython displayio library and is built on top of Adafruit Blinka and the Python Imaging Library. The idea behind the PyPortal library is to be able to run many of the examples that are currently available for the PyPortal with minimal changes.

## Parts

To run the examples, you'll need a Raspberry Pi or FT232H. If you are going the Raspberry Pi route, a Raspberry Pi 4 is preferred due to its processing speed:

### Raspberry Pi 4 Model B - 4 GB RAM

[Raspberry Pi 4 Model B - 4 GB RAM](https://www.adafruit.com/product/4296)
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing _better_! And what could make the Pi 4 better than the 3? How about a&nbsp;_faster_ processor, USB 3.0 ports, and updated Gigabit Ethernet chip with...

In Stock
[Buy Now](https://www.adafruit.com/product/4296)
[Related Guides to the Product](https://learn.adafruit.com/products/4296/guides)
![Angled shot of Raspberry Pi 4](https://cdn-shop.adafruit.com/640x480/4296-11.jpg)

For the Raspberry Pi, you will also need a PiTFT such as the 3.2" TFT:

### PiTFT Plus 320x240 3.2" TFT + Resistive Touchscreen

[PiTFT Plus 320x240 3.2" TFT + Resistive Touchscreen](https://www.adafruit.com/product/2616)
Is this not the cutest little display for the Raspberry Pi? It features a 3.2" display with 320x240 16-bit color pixels and a resistive&nbsp;touch overlay. The plate uses the high speed SPI interface on the Pi and can use the mini display as a console, X window port, displaying images or...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2616)
[Related Guides to the Product](https://learn.adafruit.com/products/2616/guides)
![Pink polished finger touching the screen of a PiTFT Plus 320x240 3.2" TFT + Resistive Touchscreen. ](https://cdn-shop.adafruit.com/640x480/2616-00.jpg)

If you would like to play sound, one of the easiest ways is to connect an amplified speaker to the Raspberry Pi such as the Monoprice 5-watt amp:

If you would prefer to run it directly from your computer, you could use an FT232H:

### Adafruit FT232H Breakout - General Purpose USB to GPIO, SPI, I2C

[Adafruit FT232H Breakout - General Purpose USB to GPIO, SPI, I2C](https://www.adafruit.com/product/2264)
Wouldn't it be cool to drive a [tiny&nbsp;OLED display](https://www.adafruit.com/categories/98), read a [color...](https://www.adafruit.com/products/1334)

In Stock
[Buy Now](https://www.adafruit.com/product/2264)
[Related Guides to the Product](https://learn.adafruit.com/products/2264/guides)
![Angled Shot of the Adafruit FT232H Breakout - General Purpose USB to GPIO, SPI, I2C](https://cdn-shop.adafruit.com/640x480/2264-07.jpg)

For the FT232H, you will need a Breakout TFT such as the 2.8" TFT Breakout:

### 2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket

[2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket](https://www.adafruit.com/product/1770)
Add some jazz & pizazz to your project with a color touchscreen LCD. This TFT display is big (2.8" diagonal) bright (4 white-LED backlight) and colorful! 240x320 pixels with individual RGB pixel control, this has way more resolution than a black and white 128x64 display. As a bonus,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1770)
[Related Guides to the Product](https://learn.adafruit.com/products/1770/guides)
![Close Up Demo Shot of the TFT breakout wired to arduino, showing a finger drawing a heart, star, and swirling line using the touchscreen.](https://cdn-shop.adafruit.com/640x480/1770-00.jpg)

- [Next Page](https://learn.adafruit.com/running-pyportal-code-on-blinka-with-displayio/raspberry-pi-setup.md)

## Featured Products

### Raspberry Pi 4 Model B - 4 GB RAM

[Raspberry Pi 4 Model B - 4 GB RAM](https://www.adafruit.com/product/4296)
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing _better_! And what could make the Pi 4 better than the 3? How about a&nbsp;_faster_ processor, USB 3.0 ports, and updated Gigabit Ethernet chip with...

In Stock
[Buy Now](https://www.adafruit.com/product/4296)
[Related Guides to the Product](https://learn.adafruit.com/products/4296/guides)
### PiTFT Plus 320x240 3.2" TFT + Resistive Touchscreen

[PiTFT Plus 320x240 3.2" TFT + Resistive Touchscreen](https://www.adafruit.com/product/2616)
Is this not the cutest little display for the Raspberry Pi? It features a 3.2" display with 320x240 16-bit color pixels and a resistive&nbsp;touch overlay. The plate uses the high speed SPI interface on the Pi and can use the mini display as a console, X window port, displaying images or...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2616)
[Related Guides to the Product](https://learn.adafruit.com/products/2616/guides)
### PiTFT Plus Assembled 320x240 2.8" TFT + Resistive Touchscreen

[PiTFT Plus Assembled 320x240 2.8" TFT + Resistive Touchscreen](https://www.adafruit.com/product/2298)
Is this not the cutest little display for the Raspberry Pi? It features a 2.8" display with 320x240 16-bit color pixels and a resistive&nbsp;touch overlay. The plate uses the high speed SPI interface on the Pi and can use the mini display as a console, X window port, displaying images or...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2298)
[Related Guides to the Product](https://learn.adafruit.com/products/2298/guides)
### Monoprice 5-Watt Guitar Amplifier, Portable Recorder

[Monoprice 5-Watt Guitar Amplifier, Portable Recorder](https://www.adafruit.com/product/4402)
Always be ready rock out or record&nbsp;with this **5-watt Guitar Amplifier, Portable Recorder, and USB Audio Interface** from Monoprice.

This handheld 5-watt amp delivers plenty of loudness and clarity for ad hoc _al fresco_ performances. It has a built-in guitar...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/4402)
[Related Guides to the Product](https://learn.adafruit.com/products/4402/guides)
### Stereo 3.5mm Plug/Plug Audio Cable - 6 feet

[Stereo 3.5mm Plug/Plug Audio Cable - 6 feet](https://www.adafruit.com/product/876)
This basic cable comes with two 3.5mm (1/8" headphone jack size) stereo connectors. It's fairly straight forward, you'll commonly need these to connect two audio devices together.  
  
Cable is 6 ft long.

In Stock
[Buy Now](https://www.adafruit.com/product/876)
[Related Guides to the Product](https://learn.adafruit.com/products/876/guides)
### Adafruit FT232H Breakout - General Purpose USB to GPIO, SPI, I2C

[Adafruit FT232H Breakout - General Purpose USB to GPIO, SPI, I2C](https://www.adafruit.com/product/2264)
Wouldn't it be cool to drive a [tiny&nbsp;OLED display](https://www.adafruit.com/categories/98), read a [color...](https://www.adafruit.com/products/1334)

In Stock
[Buy Now](https://www.adafruit.com/product/2264)
[Related Guides to the Product](https://learn.adafruit.com/products/2264/guides)
### 2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket

[2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket](https://www.adafruit.com/product/1770)
Add some jazz & pizazz to your project with a color touchscreen LCD. This TFT display is big (2.8" diagonal) bright (4 white-LED backlight) and colorful! 240x320 pixels with individual RGB pixel control, this has way more resolution than a black and white 128x64 display. As a bonus,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1770)
[Related Guides to the Product](https://learn.adafruit.com/products/1770/guides)
### Full Sized Premium Breadboard - 830 Tie Points

[Full Sized Premium Breadboard - 830 Tie Points](https://www.adafruit.com/product/239)
This is a 'full-size' premium quality breadboard, 830 tie points. Good for small and medium projects. It's 2.2" x 7" (5.5 cm x 17 cm) with a standard double-strip in the middle and two power rails on both sides. You can pull the power rails off easily to make the...

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

## Related Guides

- [Raspberry Pi Care and Troubleshooting](https://learn.adafruit.com/raspberry-pi-care-and-troubleshooting.md)
- [Processing on the Raspberry Pi & PiTFT](https://learn.adafruit.com/processing-on-the-raspberry-pi-and-pitft.md)
- [PiTFT Python + Pillow Animated Gif Player](https://learn.adafruit.com/pitft-linux-python-animated-gif-player.md)
- [CircuitPython Libraries and Jupyter Notebook on any Computer with MCP2221](https://learn.adafruit.com/jupyter-on-any-computer-with-circuitpython-libraries-and-mcp2221.md)
- [Adafruit FT232H With SPI & I2C Devices](https://learn.adafruit.com/adafruit-ft232h-with-spi-and-i2c-libraries.md)
- [Adafruit FT232H Breakout](https://learn.adafruit.com/adafruit-ft232h-breakout.md)
- [DIY WiFi Raspberry Pi Touchscreen Camera](https://learn.adafruit.com/diy-wifi-raspberry-pi-touch-cam.md)
- [RasPipe: A Raspberry Pi Pipeline Viewer, Part 2](https://learn.adafruit.com/raspipe-a-raspberry-pi-pipeline-viewer-part-2.md)
- [Raspberry Pi + Teachable Machine = Teachable Pi](https://learn.adafruit.com/teachable-machine-raspberry-pi-tensorflow-camera.md)
- [User-space SPI TFT Python Library - ILI9341](https://learn.adafruit.com/user-space-spi-tft-python-library-ili9341-2-8.md)
- [Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi](https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi.md)
- [CircuitPython Libraries on any Computer with FT232H](https://learn.adafruit.com/circuitpython-on-any-computer-with-ft232h.md)
- [Programming Microcontrollers using OpenOCD on a Raspberry Pi](https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi.md)
- [CircuitPython Hardware: ILI9341 TFT & FeatherWing](https://learn.adafruit.com/micropython-hardware-ili9341-tft-and-featherwing.md)
- [Adafruit 2.23" Monochrome OLED Bonnet](https://learn.adafruit.com/adafruit-2-23-monochrome-oled-bonnet.md)
- [Moonshine Voice Control on Raspberry Pi](https://learn.adafruit.com/moonshine-voice-control-on-raspberry-pi.md)
