Setting up the Raspberry Pi is easy. Since the PiTFT comes preassembled, all you need to do is place it onto the GPIO pins.
Since there are dozens of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, please visit the guide for CircuitPython on Linux to see whether your platform is supported.
Connect the display as shown below to your Raspberry Pi.
If you are using a Raspberry Pi 4 and have some active cooling on it such as the Pimoroni Fan Shim or Heatsink Case, you may want to attach a 40-pin stacking header so that the pins on the PiTFT don't interfere:
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!
We also need PIL, the Python Imaging Library, to allow 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:
sudo apt-get install python3-pil
A recent improvement of the RGB_Display library makes use of NumPy for additional speed. This can be installed with the following command:
sudo apt-get install python3-numpy
You'll next want to install the Blinka PyPortal library. Installing this library will also install all of the dependencies, so it's really easy to setup. Just run the following command:
pip3 install adafruit-blinka-pyportal
If you want to use a 3.5" PiTFT, then you will need to do a little extra work. First, you'll need to install the HX8357 library. You can do that by using the following comand:
pip3 install adafruit-circuitpython-hx8357
Next you'll need to initialize the display at the beginning of the example and pass it into the initializer. We'll go over that on the Running Examples page.
Most of the PiTFT hats either have a 40-pin or a 26-pin connector on the back that allows you to connect more sensors. We also conveniently have both 40-pin and 26-pin versions of the Pi cobbler that will connect to the back of the panel so that you can hook up more sensors.