# PiGRRL Zero

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/032/063/medium800/raspberry_pi_pigrrlzero-table-double.jpg?1462116297)

https://www.youtube.com/watch?v=UAIILlANNj4

You've seen PiGRRL, Super Game Pi, PiGRRL Pocket, PiGRRL 2 and now... it's time for PiGRRL Zero!

In this tutorial we'll turn the elusive&nbsp;$5 Raspberry Pi Zero into portable game console!

## Features

- Retropie Emulation Station: SNES, NES, SEGA, N64, and many many more!
- 14 Buttons, including D-Pad, L & R shoulder, Start/Select, A, B, X, Y and two extras.
- 2.2" Adafruit PiTFT 320x240 Color Display
- Landscape portable console format

The USB-A port allows you to add any&nbsp;peripherals to the Raspberry Pi Zero, such as a WiFi or Bluetooth&nbsp;adapter, USB keyboard or mouse, USB Audio Adapter or USB Hub.

Warning: 

![](https://cdn-learn.adafruit.com/assets/assets/000/032/120/medium800/raspberry_pi_pigrrlzero-adabot.jpg?1462222705)

## Project Expectations

The difficulty of this project is intermediate. There is wiring and soldering&nbsp;involved, but no PCB hacking or sawing like our previous builds. We think this is a great project for makers who have a little bit of Pi and 3D printing experience, or are first time makers with a lot of energy and willingness to learn! This tutorial will walk you through all the steps of the assembly and&nbsp;takes about weekend to accomplish.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/032/122/medium800/raspberry_pi_pigrrlzero-topdown.jpg?1462222772)

## 3D Printed Parts

You'll need&nbsp;to 3D print the enclosure and buttons for this project. If you don't have access to one, 3DHubs.com is a great option - simply download the STL files, upload them and choose a local hub to print and ship them to you!

## Prerequisite Guides

If you're new to soldering, definitely check out Collin's Lab: Soldering. You'll learn the basics of soldering and how fun it can be!

- [Learn how-to solder. Collin's Lab: Soldering](../../../../collins-lab-soldering/video)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/023/medium800/raspberry_pi_parts-2.jpg?1462039884)

## Parts

You'll need the following components to make this project.

- 1x&nbsp;[Adafruit PiTFT 2.2"](https://www.adafruit.com/products/2315)
- 1x&nbsp;[Raspberry Pi Zero](https://www.adafruit.com/products/2885)
- 1x&nbsp;[PowerBoost&nbsp;1000C](https://www.adafruit.com/products/2465)
- 1x&nbsp;[2000mAh Battery](https://www.adafruit.com/products/2011)
- 10x&nbsp;[6mm Tactile Buttons](https://www.adafruit.com/products/367)
- 2x [Soft Switches](https://www.adafruit.com/product/3101) (for Shoulder Buttons)
- 1x&nbsp;[Slide Switch](https://www.adafruit.com/products/805)
- 1x&nbsp;[USB Mini Wifi Adapter](https://www.adafruit.com/products/814)
- 1x&nbsp;[Tiny OTG Adapter - USB Micro to USB](https://www.adafruit.com/products/2910)
- 2x&nbsp;[PiGRRL Zero Gamepad PCBs](https://www.adafruit.com/products/2934)
- 1x&nbsp;[2x20-pin Strip Dual Male Header](https://www.adafruit.com/products/2822)

The following parts are optional.

- 1x&nbsp;[USB Audio Adapter](https://www.adafruit.com/products/1475)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/421/medium800/raspberry_pi_pizero-gamepad-hero.jpg?1462982379)

[Gamepad PCB on OSH Park ](https://oshpark.com/shared_projects/zVimevnd)
## Tools and Supplies

The following tools and supplies will help you build&nbsp;this project.

- [3D Printer](https://www.adafruit.com/category/128)&nbsp;+&nbsp;[Filament](https://www.adafruit.com/products/2080)
- [Soldering Iron](https://www.adafruit.com/categories/84)&nbsp;+&nbsp;[Solder](https://www.adafruit.com/categories/84)
- [30AWG](https://www.adafruit.com/products/2051)&nbsp;+ [26AWG](https://www.adafruit.com/products/1970)&nbsp;Wire
- [Helping Third Hands](https://www.adafruit.com/products/291)&nbsp;/&nbsp;[Panavise](https://www.adafruit.com/products/151)
- [Heat Shrink](https://www.adafruit.com/products/1649)
- Glue / Mounting Tack
- [Wire Stripper](https://www.adafruit.com/products/527)&nbsp;/&nbsp;[Cutters](https://www.adafruit.com/products/152)
- Filing Tool / Hobby Knife
- 6x #4-40 3/8 (M3 x 9.5mm)machine screws

![](https://cdn-learn.adafruit.com/assets/assets/000/032/123/medium800/raspberry_pi_pigrrlzero-ports.jpg?1462222818)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/124/medium800/raspberry_pi_pigrrlzero-right.jpg?1462222830)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/125/medium800/raspberry_pi_pigrrlzero-shoulders.jpg?1462222843)

# PiGRRL Zero

## Circuit Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/109/107/medium800/gaming_raspberry_pi_pigrrlzero-circuit-diagram-fixed.jpg?1645484480)

Warning: 

## Wired Connections

The diagram above depicts the connections for the power, audio and gamepad. Use this as a reference for wiring the components. Note, the length of wires and position of components are not exactly how the circuit will be - it’s just a diagram to show connections.

```auto
{  18,   KEY_LEFT		},  // Left
{  24,   KEY_RIGHT		},  // Right
{   5,   KEY_DOWN		},  // Down
{   6,   KEY_UP			},  // Up
{  12,   KEY_Z			},  // A
{  13,   KEY_X			},  // B
{  16,   KEY_A			},  // X
{  19,   KEY_S			},  // Y
{  20,   KEY_Q			},  // L
{  21,   KEY_W			},  // R
{  17,   KEY_ESC		},  // TFT 17
{  22,   KEY_LEFTCTRL	},  // TFT 22 SELECT
{  23,   KEY_ENTER		},  // TFT 23 START
{  27,   KEY_4			},  // TFT 27
```

## GPIO&nbsp;Wired Connections

Follow the table above to reference which buttons to wire to the GPIO. The numbers on the left represent the corresponding GPIO number (NOT the pin number).

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/033/331/medium800/raspberry_pi_pitft-gamepad-prep.jpg?1467032344)

## Gamepad Connections

When the PiTFT is flipped over, the connections are reversed. This diagram references the connections from the back of the PiTFT and Gamepad PCBs. This is most likely how you will&nbsp;wire the buttons to the pins on PiTFT. The colors match with each corresponding button and GPIO&nbsp;number.

# PiGRRL Zero

## Software

Warning: 

## Ready-To-Go Raspberry Pi IMG

Click the button below to download the PiGRRL Zero img. You'll need to burn this to an SD card (2 GB minimum) using a image burning tool,&nbsp;[like the ones listed in the guide](../../../../adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi)

Once the img has been burnt to a blank SDCard, insert it into the Raspberry Pi Zero. The image is preloaded&nbsp;with tools, emulators, some games and preconfigured buttons for the gamepad controls. It will only work with the PiTFT (So plugging in an HDMI monitor might not display anything).

Danger: 

[Download PiGRRL Zero IMG](https://adafruit-download.s3.amazonaws.com/PiGRRL_Zero_20160912.zip)
**After first boot, you'll need to expand the filesystem to fill the SD card. This requires having&nbsp;a keyboard attached temporarily (either through a USB hub or a USB-A-to-micro adapter).**

**From the EmultationStation&nbsp;GUI, press “F4” to exit to a Linux command prompt. Then type “sudo raspi-config”. The very first option in this menu is “Expand Filesystem.” Run that command. Afterward, tab over to the “Finish” button and reboot when prompted.**

# PiGRRL Zero

## Software [Manual]

Info: 

# Download & Burn RetroPie

Game emulation is handled by a package called _ **RetroPie**._ It’s a complete Linux distribution designed specifically for running classic games on Raspberry Pi.

[Download the current version from the RetroPie web site](https://retropie.org.uk/download/), then [write this to an SD card](../../../../adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi) using Etcher or similar software.

We’ll then make some modifications to tune this for the PiGRRL’s buttons and small display.

Setup will require an **HDMI monitor** , **USB keyboard** and a **network connection** (a USB **WiFi** or **Ethernet** dongle, for example).&nbsp;This is best done _ **before** _ the Pi is enclosed in the PiGRRL case. If you have a spare Raspberry Pi board around, that’s an ideal option…you could&nbsp;prepare the software on that system and then move the card over to the PiGRRL.

A USB/Ethernet hub + a Keyboard is ideal

### Ethernet Hub and USB Hub w/ Micro USB OTG Connector

[Ethernet Hub and USB Hub w/ Micro USB OTG Connector](https://www.adafruit.com/product/2992)
One can never have enough socks, or USB ports.&nbsp;Add some more USB and Ethernet&nbsp;capability to your Raspberry Pi Zero or, really, any kind of tablet or computer with an OTG connector with this **USB 2.0 and Ethernet Hub**!

This handy combo-hub has 3 USB 2.0 ports, and...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2992)
[Related Guides to the Product](https://learn.adafruit.com/products/2992/guides)
![Angled shot of White hub with USB micro-B cable and Ethernet socket.](https://cdn-shop.adafruit.com/640x480/2992-10.jpg)

# Setup RetroPie

Insert the RetroPie card to your Pi, attach monitor and keyboard (and Ethernet, if networking that way), then power the system from a USB power source (a USB phone charger or a powered USB hub can usually work). The system will automatically reboot once (it needs this to make use of the whole SD card), then on second boot it will ask to configure the game controls…

**The PiGRRL buttons don’t work yet; this is normal.** For initial setup, **use the USB keyboard** to select the D-pad directions (arrow keys), Start, Select, A and B keys. For anything else, just hold down the space bar or other key to skip that item . Don't worry, we'll re-do the keymap later once we've finished assembly! When finished, you’ll see a graphical interface called _Emulation Station_ where you’ll select games and other options.

Let’s **get this Raspberry Pi on the network** first. If WiFi, from the main EmulationStation screen, access the RetroPie settings using whatever key you’ve assigned as the “A” button. You’ll see **WIFI** &nbsp;in this list:

Here you can select your WiFi network name and enter a password. It’s not beautiful, but gets the job done.

Select “Exit” when done to return to the EmulationStation UI…

![gaming_raspberry_pi_wifi2.png](https://cdn-learn.adafruit.com/assets/assets/000/038/204/medium640/gaming_raspberry_pi_wifi2.png?1483733267)

With networking enabled, we can now access the remaining software needed for the PiGRRL 2 experience. There are a couple ways to do this…

- **BEST:** Use an **ssh** terminal client to log into the Raspberry Pi at **retropie.local**   
This is recommended, as you can just copy-and-paste the commands that follow. The default name and password are “pi” and “raspberry,” respectively.
- **OR:** Press “F4” to exit EmulationStation for a command-line prompt (works, but you’ll need to type these commands _exactly_).

## Testing Retrogame

Once the SD card is finished, insert it into the Pi and boot it up. You should get emulation station to boot automatically. Configure your controls using a keyboard and test out the games in the ports section to make sure everything is running properly.

# Setup Virtual Environment

If you are installing on the Bookworm version of Raspberry Pi OS or later, you will need to install your python modules in a virtual environment. You can find more information in the [Python Virtual Environment Usage on Raspberry Pi](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi) guide. To Install and activate the virtual environment, use the following commands:

```terminal
sudo apt install python3-venv
python -m venv env --system-site-packages
```

To activate the virtual environment:

```terminal
source env/bin/activate
```

To deactivate, you can use&nbsp;`deactivate`, but leave it active for now.

# Install Script Dependencies

Install the necessary script dependencies for the following steps:

```terminal
cd ~
sudo apt-get update
sudo apt-get install -y git python3-pip
pip3 install --upgrade adafruit-python-shell click
git clone https://github.com/adafruit/Raspberry-Pi-Installer-Scripts.git
```

# Install PiTFT (mirroring) Support

This first sequence configures the system for the PiTFT display:

```terminal
cd ~/Raspberry-Pi-Installer-Scripts
sudo -E env PATH=$PATH python3 pitft-fbcp.py
```

Select the “PiGRRL Zero” option, which sets up various system parameters&nbsp;to match this project.

![](https://cdn-learn.adafruit.com/assets/assets/000/038/205/medium800/raspberry_pi_fbft.png?1483733328)

Answer “ **NO** ” to the reboot question…

![](https://cdn-learn.adafruit.com/assets/assets/000/038/206/medium800/raspberry_pi_noreboot.png?1483733645)

# Edit&nbsp;Config.txt

For optimized speed and decent audio from the emulators, may want to to tweak some settings in the config.txt file, for overclocking/gpu configuration

run **sudo nano /boot/config.txt** and add/edit the end of the file:

```auto
gpu_mem=44
disable_audio_dither=1
overscan_scale=1
#gpu_mem_256=128
#gpu_mem_512=256
#gpu_mem_1024=256
dtoverlay=pitft22,rotate=270,speed=60000000,fps=40
display_rotate=0
hdmi_cvt=320 240 60 1 0 0 0
arm_freq=1000
core_freq=500
sdram_freq=450
over_voltage=6
```

Also, set the audio to 3.5mm with **sudo raspi-config** (under Advanced/Audio)

![](https://cdn-learn.adafruit.com/assets/assets/000/038/207/medium800/raspberry_pi_35mm.png?1483733735)

# Installing Keypress (retrogame) support

let’s take care of this second script, which enables the PiGRRL buttons:

```terminal
cd ~/Raspberry-Pi-Installer-Scripts
sudo -E env PATH=$PATH python3 retrogame.py
```

Again, select the “PiGRRL Zero” option. When finished, _now_ you can reboot when prompted.

![](https://cdn-learn.adafruit.com/assets/assets/000/038/208/medium800/raspberry_pi_config.png?1483733925)

After rebooting, the HDMI monitor may display a “no signal” message. This is normal. Not all monitors can handle the resolution setting we’re using. Once the PiTFT is wired up, that will be the primary display.

Also, **after&nbsp;the system is assembled with the PiTFT and controls** , you’ll need to **re-do the controller setup.** This might wait ’til all the parts are **assembled in the case.**

From the main EmulationStation screen, press whatever key was assigned to the “Start” button to access the main menu. You’ll find an option here for “CONFIGURE INPUT.”

Go through the control setup process again using the PiGRRL buttons now instead of the keyboard; assign the D-pad directions, Start and Select buttons, A, B, X and Y. For anything else, hold down a key or button to skip it.

![gaming_raspberry_pi_input.png](https://cdn-learn.adafruit.com/assets/assets/000/038/209/medium640/gaming_raspberry_pi_input.png?1483734339)

# PiGRRL Zero

## 3D Printing

![](https://cdn-learn.adafruit.com/assets/assets/000/031/516/medium800/raspberry_pi_3dpartsB.jpg?1459539497)

## 3D Files

Download the STLs by clicking on the button below. The table references the file names, their use and recommend material.&nbsp;

[Pinshape Download](https://pinshape.com/items/21978-3d-printed-pigrrl-zero-raspberry-pi-gameboy)
[Thingiverse Download](http://www.thingiverse.com/thing:1546607)
[Cults3D Download](https://cults3d.com/en/game/pigrrl-zero-raspberry-pi-gameboy)
[YouMagine Download](https://www.youmagine.com/designs/pigrrl-zero-raspberry-pi-gameboy)
## Suggested&nbsp;Slice Settings

Each printer and slicing software is different.&nbsp;Although we can't possible test each printer profile out, we do however have some suggested settings (these are for a 3D printer with a 0.4mm nozzle and 1.75mm filament).

- Extrusion Multiplier: 1.00
- Extrusion Width: 0.48mm
- Retraction Dist. 1mm
- Retraction Speed: 30mm/s
- Layer Height: 0.2mm
- Top / Bottom Layers: 4
- Outline/ Perimeter Shells: 2
- First Layer Height: 100%
- First Layer Width: 100%
- First Layer Speed: 50%
- Default Printing Speed: 60mm/s - 90mm/s
- Movement Speed: 90mm/s - 150mm/s
- Solid Infill Underspeed: 50%
- Interior Infill: 25%
- Outline Overlap: 25%
- Infill Width: 100%
- Extruder Temp: 220c
- Heated Bed: 0c - 60c

## Ninjaflex / TPE Filaments

Since&nbsp;TPE filament is a rubber based material, the slice settings will need to be slightly different. Typically you need to print hotter, slower, and completely disable retraction.

- Extruder Temp: 230c - 240c
- Default Printing Speed: 30mm/s
- Movement Speed: 40mm/s
- Retraction: OFF

## 3D Post Processing

It's a good idea to thoroughly inspect your parts&nbsp;after 3D printing. Check to see if there's any defects in the surfaces and walls of each part.

Test fitting the parts to see if the tolerances are balanced. Do the DPad and action buttons fit into the holes? Can the two halves snap fit together? Are the standoffs strong, or do they easily break apart? These are all dependent&nbsp;on your slice settings.

There's a total of 8 standoff's with mounting holes. It's a good idea to tap&nbsp;these in order to create the threads before mounting components. They're sized for #4-40 machine screws (or M3).

If you're interested and giving the surface a smooth finish, you can optional sand the parts down and apply [Smooth-On XTC3D](http://www.amazon.com/XTC-3D-High-Performance-Print-Coating/dp/B00PFXK4JY)&nbsp;coating.

## Download, Modify, Remix

The design is open source, so you can make modifications and remix the design. It was designed in Autodesk Fusion 360. You can download the source file in your choice of file format (IGS, STEP, SAT, etc.)

[Download Source](http://a360.co/272vF6x)
## But I Don't Have a 3D Printer!

That's totally OK, you can still buy the parts and have them shipped to you! You can use a service like 3D Hubs to 3D print&nbsp;all of the parts for&nbsp;you. Just download all of the STL files from our Thingiverse page and upload them to their website.

![](https://cdn-learn.adafruit.com/assets/assets/000/032/018/medium800/raspberry_pi_3dhubs-page.jpg?1462025027)

## Using 3D Hubs App on Thingiverse

The easiest way to do this is to use the "Print" button on the Thingiverse page. Then, click on the Launch App button to automatically load the STL files into 3D Hubs. From there, you can select colors, materials and enter your shipping address. A total price will let you know how much the parts will cost. A list of local hubs will appear and you can select which ever looks good to you. Hubs have different prices, ratings, reviews, and sample photos so you can narrow down your choice.

&nbsp;

![raspberry_pi_print-thingiverse.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/016/medium640/raspberry_pi_print-thingiverse.jpg?1462024653)

![raspberry_pi_3dubs-thingiverse-app.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/017/medium640/raspberry_pi_3dubs-thingiverse-app.jpg?1462024673)

# PiGRRL Zero

## Gamepad

_Note: purple PCBs shown in photos are during development. Final blue PCBs switched the “B3” and “B4” pin positions._

## Install Buttons on Gamepad PCBs

Let's start by setting up&nbsp;our buttons. Insert each button&nbsp;on the side of the PCB with the "BUTTON PAD" writing. Make&nbsp;sure the orientation of&nbsp;the legs on the buttons are positioned with the pins. Push them into the holes so they're all the way in, flush with the surface of the PCB.

![raspberry_pi_gamepad-buttons.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/019/medium640/raspberry_pi_gamepad-buttons.jpg?1462026232)

![raspberry_pi_gamepad-buttons-insert.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/020/medium640/raspberry_pi_gamepad-buttons-insert.jpg?1462026246)

## Solder Buttons to Gamepad

Flip the PCB over and secure it to a Panavise Jr. or Helping Third Hands. Then, add&nbsp;solder to&nbsp;all of the pins.

Repeat this proceedure for the second gamepad PCB.

![raspberry_pi_gamepad-buttons-soldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/021/medium640/raspberry_pi_gamepad-buttons-soldered.jpg?1462026608)

![raspberry_pi_gamepads-finished.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/022/medium640/raspberry_pi_gamepads-finished.jpg?1462026673)

# PiGRRL Zero

## Pi Zero

## Install&nbsp;Headers to Pi Zero

The Raspberry Pi Zero ships with no headers installed on the GPIO. Insert the 2x20 (or two 1x20) headers into the GPIO like shown the photo. The black plastic bit should be on top of the PCB.&nbsp;

![raspberry_pi_pi-heads.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/024/medium640/raspberry_pi_pi-heads.jpg?1462040475)

![raspberry_pi_pi-headers-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/025/medium640/raspberry_pi_pi-headers-installed.jpg?1462040488)

## Tack Headers to PCB

Use tape or mounting tack to hold the header onto the PCB. Then, secure the PCB to a pair of Helping Third Hands or a Panavise Jr. This will make it easier to solder.

Flip the PCB over and solder all of the pins to the GPIO.

![raspberry_pi_pi-headers-stacked.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/026/medium640/raspberry_pi_pi-headers-stacked.jpg?1462040689)

![raspberry_pi_pi-headers-soldering2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/027/medium640/raspberry_pi_pi-headers-soldering2.jpg?1462040801)

## Soldered Headers

Inspect each connection and ensure there are no cold solder joints. If you find it difficult to&nbsp;apply solder to the pins, try tinning the tip of the soldering iron.

![raspberry_pi_pi-headers-solderd.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/028/medium640/raspberry_pi_pi-headers-solderd.jpg?1462040880)

# PiGRRL Zero

## PiTFT

## Cut Trace on Pin #18

In order to properly use Pin #18 (left button) we'll need to cut the trace on the back of the PiTFT. Using a sharp hobby knife, you can score in between the pads to cut the trace.&nbsp;

I recommend testing the connection with a multimeter using the continuity mode. Press&nbsp;the probes onto the pads. If the multimeter beeps, then the trace isn't completely cut. It's best to ensure the trace is cut now than later in the build.

![raspberry_pi_pitft-pin18.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/029/medium640/raspberry_pi_pitft-pin18.jpg?1462041047)

![raspberry_pi_pitft-pin18-test.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/032/medium640/raspberry_pi_pitft-pin18-test.jpg?1462041192)

# PiGRRL Zero

## Gamepad To PiTFT

Danger: 

## Measure Gamepad Wires

Grab one of the gamepads and position it close to the PiTFT (In the photo, we're doing the DPAD first). We need to measure a piece of&nbsp;wire to see how long it needs to be for the first button (The left button on the DPAD). I recommend making it slightly longer so we have some slack and wiggle room.

In the photo, I have inserted a long&nbsp;wire into Pin #18 on the back of the PiTFT. By flipping the PiTFT over, I can see which pin is labeled.

Once we've determined a good length for our first connection, cut the piece of wire.

![raspberry_pi_gamepad-measure-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/033/medium640/raspberry_pi_gamepad-measure-wires.jpg?1462041557)

## Strip & Tin Wires

Use wire strippers to remove 5mm of insulation from each tip. Then, apply a bit of solder to the tips to tin them. This will prevent the stranded wires from fraying and make it easier to solder to the pads.

![raspberry_pi_wires-strip-ends.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/035/medium640/raspberry_pi_wires-strip-ends.jpg?1462041857)

![raspberry_pi_wires-tin-ends.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/036/medium640/raspberry_pi_wires-tin-ends.jpg?1462041874)

## Inserting Wires to PiTFT

To make wiring a bit easier, I suggest inserting the wire into the corresponding pin (#18 for the left button in this case) and threading it through until the tip from the other end is touching the hole. Then, bend the tip at a right angle so it can be held in place.

![raspberry_pi_pitft-wire-insert.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/040/medium640/raspberry_pi_pitft-wire-insert.jpg?1462043795)

![raspberry_pi_pitft-wire-bend.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/041/medium640/raspberry_pi_pitft-wire-bend.jpg?1462043837)

## Solder Wire to PiTFT

Now that the wire is in place, you can solder the connection to secure it.

![raspberry_pi_pitft-wire-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/042/medium640/raspberry_pi_pitft-wire-solder.jpg?1462044055)

## Solder Wire to Gamepad

Now we can apply some solder to the header pins on the Gamepad PCB. I suggest&nbsp;tinning the pads on the header of the PCB&nbsp;before soldering wires to them so it's easier.

Although the photo shows the wire orientated from the top, I recommend positioning the wire from the bottom. This will make securing the PCB to the 3D print case easier.

![raspberry_pi_gamepad-tin-pin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/043/medium640/raspberry_pi_gamepad-tin-pin.jpg?1462044248)

![raspberry_pi_gamepad-solder-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/046/medium640/raspberry_pi_gamepad-solder-wire.jpg?1462044922)

## Wired Gamepad

Repeat this process for the rest of the buttons, up, down and right. Each button requires a different length of wire. I recommend referencing the wiring diagram closely and double checking each wire is in the correct positon. Also, try doing&nbsp;one wire at a time to prevent any confusion.

![raspberry_pi_gamepad-dpad-connected.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/047/medium640/raspberry_pi_gamepad-dpad-connected.jpg?1462045082)

![](https://cdn-learn.adafruit.com/assets/assets/000/033/688/medium800/raspberry_pi_pitft-gamepad-prep.jpg?1468070172)

## Test Gamepad Connections

It's a good idea to test your connections! Using a multimeter in continuity mode, you can probe the header pins on the PiTFT and gamepad to see if the connections have continuity - You'll hear a "BEEP" sound if the connection is solid.

![raspberry_pi_gamepad-test-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/049/medium640/raspberry_pi_gamepad-test-wires.jpg?1462045511)

## Wired Gamepads

With patience and persistance, you'll end up with two gamepads wired up to the PiTFT.&nbsp;

This part of the build is the most time consuming, so try not to rush it. Once complete, feel free take a break :-)

In the next page, we'll solder the Pi Zero to the PiTFT and sort out the other components.

![raspberry_pi_gamepad-wired-pitft.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/051/medium640/raspberry_pi_gamepad-wired-pitft.jpg?1462045691)

# PiGRRL Zero

## PiTFT To Pi Zero

Warning: 

## Install PiTFT to Pi Zero

Now we can insert the PiTFT to the Pi Zero. You'll want to group the wires from the gamepad so they aren't kinked. Slowly guide the pins from the GPIO header on the Pi Zero and seat them through the pins on the PiTFT.

![raspberry_pi_pizero-insert-pitft.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/052/medium640/raspberry_pi_pizero-insert-pitft.jpg?1462045980)

![raspberry_pi_pizero-gamepad-adjust-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/054/medium640/raspberry_pi_pizero-gamepad-adjust-wires.jpg?1462046537)

## Connecting PiTFT to Pi Zero

Look at the HDMI and USB ports on the Pi and make sure they're flush with the back of the PiTFT. The wires from the gamepad should be behind the ports.

When you seat the GPIO header from the Pi to the PiTFT, try not to fully press them together. If you do, you'll see the Pi Zero PCB will be slightly angled. Try to keep the two PCBs as&nbsp;straight as possible.

![raspberry_pi_pizero-flush-ports-pitft.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/055/medium640/raspberry_pi_pizero-flush-ports-pitft.jpg?1462046608)

## Solder PiTFT to Pi Zero

Trim the pins from the header of the Pi Zero so they're slightly taller than the pins of the PiTFT. This will make it easier to apply solder. Once they're all trimmed down, go ahead an solder all of the pins! Take your time and be sure the solder joints are solid.

![raspberry_pi_pizero-pitft-trim-pins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/056/medium640/raspberry_pi_pizero-pitft-trim-pins.jpg?1462047391)

![raspberry_pi_pizero-pitft-solder-pins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/057/medium640/raspberry_pi_pizero-pitft-solder-pins.jpg?1462047413)

## Soldered PiTFT to Pi Zero

Double check each pin and ensure they're nicely soldered.

![raspberry_pi_pizero-pitft-soldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/058/medium640/raspberry_pi_pizero-pitft-soldered.jpg?1462047976)

## Gamepad Ground Connections

Now is a good time to add ground connections for the two gamepad PCBs. We can add these to the back of the Pi Zero. Measure and cut two pieces of wires. Solder them to the available ground pads on the gamepad PCB. Then, connect those to the back of the Pi.

![raspberry_pi_pizero-gamepad-back.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/059/medium640/raspberry_pi_pizero-gamepad-back.jpg?1462048983)

![raspberry_pi_pi-gamepad-grounds.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/060/medium640/raspberry_pi_pi-gamepad-grounds.jpg?1462049028)

# PiGRRL Zero

## Power

## PowerBoost Connections

Grab the bottom half of the enclosure and sit&nbsp;the PowerBoost 1000C on top of the four standoffs near the bottom left. Then, insert the slide switch into the bottom center. These two components should just snap fit into the case.

Next, we need to measure two 26AWG wires for connecting the&nbsp;slide switch. They'll be connected to the **EN** and **GND** pins on the PowerBoost 1000C. Once you've sorted out a good length for them, strip and tin the ends of each wire.

![raspberry_pi_switch-measure-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/064/medium640/raspberry_pi_switch-measure-wires.jpg?1462120375)

Danger: 

## Prep Slide Switch

Now that we have our wires sorted out, we can prep the slide switch.&nbsp;First, we don't need three leads, so&nbsp;remove one using a pair of flush snips (it can be any of the leads on the far left or right, but not the middle). Then, trim the remaining two leads to about half their length. Now we can tin them by applying some solder.

![raspberry_pi_switch-trim-leads.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/065/medium640/raspberry_pi_switch-trim-leads.jpg?1462120803)

![raspberry_pi_switch-tin-leads.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/066/medium640/raspberry_pi_switch-tin-leads.jpg?1462120914)

## Solder Wires to Slide Switch

With the leads tinned, solder both&nbsp;wires to the two leads. Pieces of shrink tubing will insulate the exposed connections. Simply apply heat to "shrink" the tubing.

![raspberry_pi_switch-soldered-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/072/medium640/raspberry_pi_switch-soldered-wires.jpg?1462204513)

![raspberry_pi_switch-shrink-tube-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/073/medium640/raspberry_pi_switch-shrink-tube-2.jpg?1462204553)

## Connect Switch to PowerBoost 1000C

Solder one wire to the **EN** pin on the PowerBoost 1000C and the other to **GND.**

Now you can plug in the JST connector from the 2000mAh battery into the JST port on the PowerBoost 1000C. The switch will allow you to power it on and off. The blue LED will light up indicating it's powered on.

_Photos show a PowerBoost 500C, but you should use a 1000C. Pinouts are different, so read the pin labels on the PCB, don’t just follow the photos._

![raspberry_pi_switch-solder-pb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/074/medium640/raspberry_pi_switch-solder-pb.jpg?1462204759)

![raspberry_pi_test-powerboost-switch.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/075/medium640/raspberry_pi_test-powerboost-switch.jpg?1462204790)

## PowerBoost Wires&nbsp;

Next, we need to sort out a set of two 26AWG wires for connecting the PowerBoost 1000C to the Raspberry Pi Zero. We can do this like we did for the slide switch.&nbsp;

Once we have a good length, cut, strip and tin the wires. Then, solder them to the postive+ and negative+ pads on the PowerBoost 1000C.

_Photos show a PowerBoost 500C, but you should use a 1000C. Pinouts are different, so read the pin labels on the PCB, don’t just follow the photos._

![raspberry_pi_pb-measure-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/076/medium640/raspberry_pi_pb-measure-wires.jpg?1462204977)

![raspberry_pi_powerboost-pi-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/077/medium640/raspberry_pi_powerboost-pi-wires.jpg?1462205007)

## Connect PowerBoost to Raspberry Pi

Now we can solder the positive and negative connections from the PowerBoost 1000C to the GPIO pins on the back of the Raspberry Pi Zero. Reference the photo for the right pins. Red is positive, and blue is negative.

![raspberry_pi_pi-pb-soldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/078/medium640/raspberry_pi_pi-pb-soldered.jpg?1462205192)

# PiGRRL Zero

## USB

## USB Adapters

OK, now it's time to work on the USB adapters. Grab the USB OTG adapter and the USB female port (this came with the PowerBoost 1000C). We need to create a set of 4 wires that will connect these two components together.

This is necessary for connecting&nbsp;peripherals to the Raspberry Pi such as WiFi adapter, USB Audio adapter and&nbsp;more.

![raspberry_pi_usb-adapters.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/079/medium640/raspberry_pi_usb-adapters.jpg?1462205312)

## Remove Legs from USB Female Jack

Use a pair of flush snips to cut off the legs from the female USB jack. These prevent the port from being able to fit into the case. They're&nbsp;normally used to secure the jack to pins on a PCB, but since we're mounting to it the case, we don't need them.

![raspberry_pi_usb-remove-legs.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/080/medium640/raspberry_pi_usb-remove-legs.jpg?1462205488)

![raspberry_pi_usb-legs-removed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/081/medium640/raspberry_pi_usb-legs-removed.jpg?1462205505)

## Prep USB&nbsp;Pins

Next, we need to bend the four connectors on the USB female jack so they're right-angled. As they are now, it wouldn't fit in the case. Use a pair of flush pliers to carefully bend each connector. You'll want to be cautious while doing this. The connectors MUST NOT touch the metal housing - if it does, it'll short out the connection. You can optional remove the metal back piece from the USB jack.

![raspberry_pi_usb-bend-leads.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/082/medium640/raspberry_pi_usb-bend-leads.jpg?1462205656)

![raspberry_pi_usb-bent-leads.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/083/medium640/raspberry_pi_usb-bent-leads.jpg?1462206377)

## USB Wires

We'll need to make a set of four wires for connecting our USB adapters together. I found 13cm to be a good length. Like we've done previously, strip and tin the ends of each wire. A piece of heat shrink tubing will keep these four wires together.

![raspberry_pi_usb-wires-13cm.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/086/medium640/raspberry_pi_usb-wires-13cm.jpg?1462215257)

## Connect Wires to USB OTG Adapter

Most microUSB cables follow the same color coded wiring.&nbsp;

- Black / Blue – GND
- Red – VCC 5V
- Green – USB Data -
- White – USB Data +

Follow the photo to reference which wire to connect to the correct&nbsp;pin. Tinning the four&nbsp;pins on the USB OTG adapter will make it easier to solder the wires to them.

![raspberry_pi_uotg-adapter-tinned.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/087/medium640/raspberry_pi_uotg-adapter-tinned.jpg?1462215551)

![raspberry_pi_uotg-soldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/088/medium640/raspberry_pi_uotg-soldered.jpg?1462215578)

## Connect Wires to Female USB Jack

Following a similar method, connect the four wires to the pins on the Female USB jack. Note the colors are reversed. That's because we have the USB jack fliped. Make sure you familarize yourself with the&nbsp;top and bottom of the USB jack. The bottom has the white plastic bit.

![raspberry_pi_usb-soldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/089/medium640/raspberry_pi_usb-soldered.jpg?1462216338)

# PiGRRL Zero

## Shoulder Buttons

## Shoulder Buttons

Now it's time to work on the shoulder buttons. The two buttons I used in this project are 2-terminal&nbsp;versions that come with extra long legs. The ones included in the kit&nbsp;have four legs. You only need to use two of them. &nbsp;

![raspberry_pi_shoulder-buttons.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/090/medium640/raspberry_pi_shoulder-buttons.jpg?1462216960)

## Measure Shoulder Button Wires

Layout the two buttons and plan out the lengths of each wire. The L and R shoulder buttons will need to be connected to the last two remaining pins on PiTFT (#20 and #21) and the remaining ground pins on the Gamepad PCBs.&nbsp;

![raspberry_pi_shoulder-button-layout.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/091/medium640/raspberry_pi_shoulder-button-layout.jpg?1462218167)

## Shoulder Button&nbsp;Wires

Once you've measured each wire, we'll prep them by striping and tinning the tips. You'll also want to tin the leads on each button.

![raspberry_pi_shoulder-button-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/092/medium640/raspberry_pi_shoulder-button-wires.jpg?1462218321)

## Connect Wires to Buttons

Solder the wires to the terminals on each button.

![raspberry_pi_shoulder-buttons-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/093/medium640/raspberry_pi_shoulder-buttons-wired.jpg?1462218457)

## Connect Wires to PiTFT

Connecting the left shoulder button to the PiTFT is a little tricky because it needs to be threaded through the PiTFT and Raspberry Pi. Using the similar method we did when connecting the gamepad PCB wires to the PiTFT, the tinned tip of the wire should be able to poke through pin #20. Once it is, solder it in place. The right shoulder button is much easier to connect since pin #21 is close to the edge.&nbsp;

![raspberry_pi_left-shoulder-pitft.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/094/medium640/raspberry_pi_left-shoulder-pitft.jpg?1462218674)

## Ground Shoulder Buttons

With the two buttons connected&nbsp;to the PiTFT, solder the remaining connection to the ground pins on the gamepad PCB.

![raspberry_pi_shoulder-ground-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/095/medium640/raspberry_pi_shoulder-ground-wired.jpg?1462219328)

# PiGRRL Zero

## Mounting Components

## Connect USB OTG Adapter

Before mounting the components, go ahead and plug in the micro USB OTG adapter to the Raspberry Pi.

![raspberry_pi_uotg-plugin-pi.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/096/medium640/raspberry_pi_uotg-plugin-pi.jpg?1462219575)

## Test Final Circuit

OK, now is a great time to test the circuit. Make sure the PiGRRL Zero IMG has been properly burnt to the SD card and inserted into the Raspberry Pi. "Flip" the switch and the PiTFT should turn on. The&nbsp;Pi will take about a minute to boot up.&nbsp;

The controls are premapped so you can test the gamepad PCBs. Try a play test with one of the games in the PORTS section. Use the&nbsp;"A" button to select. To exit a game, hold down the two middle buttons (select and start) on the PiTFT.

![raspberry_pi_test-final-circuit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/097/medium640/raspberry_pi_test-final-circuit.jpg?1462219697)

## Verify Test

If you find something off or doesn't work as expected, feel free to post your questions or concerns&nbsp;in the [Adafruit Forums](http://forums.adafruit.com/).

If everything works as expected, feel free to move onto the final steps!

## Mount PowerBoost 1000C

Let's start with the PowerBoost. This is mounted to the bottom half of the enclosure, near the bottom&nbsp;right. The microUSB port should be pointing&nbsp;towards the opening. Simply lay the PCB over the standoffs and press it down so the pegs are seated into the mounting holes.

_Photos show a PowerBoost 500C, but you should use a 1000C. The battery connector will be on the opposite edge._

![raspberry_pi_pb-installed-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/098/medium640/raspberry_pi_pb-installed-case.jpg?1462220213)

## Mount Slide Switch

The slide switch can be installed into the bottom half of the case by inserting it at an angle.

![raspberry_pi_install-switch-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/099/medium640/raspberry_pi_install-switch-case.jpg?1462220331)

## Mount Female USB Jack

Similar to the slide switch, you'll need to insert the female USB jack at an angle. A slight amount of force is required to snap fit the housing of the USB jack into the opening.

![raspberry_pi_install-usb-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/100/medium640/raspberry_pi_install-usb-case.jpg?1462220459)

![raspberry_pi_installed-usb-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/101/medium640/raspberry_pi_installed-usb-case.jpg?1462220532)

## Install Battery

There isn't a dedicated "holder" for the battery, but a good location for the battery is near the top center. I suggest using either double-sided tape or mounting tack to keep the battery in place.

![raspberry_pi_install-battery-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/102/medium640/raspberry_pi_install-battery-case.jpg?1462220568)

## Screws and Washers

We'll need two #4-40 3/8 flat Phillips machine screws to install the PiTFT to the case. 3D printed washers will help prevent the screws from&nbsp;poke through the enclosure. Fasten each screw into these washers.&nbsp;

![raspberry_pi_washers-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/105/medium640/raspberry_pi_washers-screws.jpg?1462220804)

![raspberry_pi_washers-screwed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/106/medium640/raspberry_pi_washers-screwed.jpg?1462220817)

## Install&nbsp;Actuators

Grab the top half of the enclosure and insert the&nbsp;DPad, action buttons and 4-grouped menu buttons.

![raspberry_pi_install-rubber-buttons-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/104/medium640/raspberry_pi_install-rubber-buttons-case.jpg?1462220691)

## Install PiTFT to Case

Position the full circuit into the top half of the case. Line up the mounting holes of the PiTFT with the standoffs in the center of the case.&nbsp;

![raspberry_pi_pitft-holes-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/107/medium640/raspberry_pi_pitft-holes-case.jpg?1462220950)

## Fasten Screws

Insert&nbsp;one machine screw into one of the bottom mounting holes of the PiTFT. Hold the PCB down to the case while fastening the screw through the PCB and standoff until the washer is flush with the surface. Repeat for the second machine screw.

![raspberry_pi_fasten-screws-pitft-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/108/medium640/raspberry_pi_fasten-screws-pitft-case.jpg?1462221127)

![raspberry_pi_pitft-case-installed-washers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/109/medium640/raspberry_pi_pitft-case-installed-washers.jpg?1462221153)

## Gamepad PCB Mounting Holes

There's two mounting holes on each gamepad PCB needs to be tapped. Using a #4-40 machine screw, you can create the threads by slowly fastening through the hole. I suggest doing this before mounting the PCB to the stand offs on the case - It'll make it easier.

![raspberry_pi_fasten-screws-gamepad.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/110/medium640/raspberry_pi_fasten-screws-gamepad.jpg?1462221365)

## Mount Gamepad PCBs

With the mounting holes tapped, position the PCB over the standoffs on the case and hold it in place. Then, fasten screws through the mounting holes. Do not&nbsp;fully fasten the screws into the standoffs – They only need to be fastened half way. The screw may poke through the case if it's&nbsp;fully fasten through.

![raspberry_pi_gamepad-installed-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/111/medium640/raspberry_pi_gamepad-installed-case.jpg?1462221614)

![raspberry_pi_gamepad-installed-case-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/112/medium640/raspberry_pi_gamepad-installed-case-2.jpg?1462221636)

## Mount Shoulder Buttons

A small piece of mouting tack will keep the shoulder buttons in place. Near the top of the gamepad standoffs is a holder for the shoulder buttons. Insert the shoulder button into the holder with the actuator pointing towards the top.

![raspberry_pi_should-button-tack.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/113/medium640/raspberry_pi_should-button-tack.jpg?1462221992)

![raspberry_pi_installed-shoulder-button.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/114/medium640/raspberry_pi_installed-shoulder-button.jpg?1462222015)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/420/medium800/raspberry_pi_case-open.jpg?1462981020)

## Final Circuity Check

Now is a good time to&nbsp;check all of your work. Are all of the wires connected? Are all the components secured? If you find some of the wires are too long, it's fine to trim them short.&nbsp;

## Close Case

Carefully join the two halves of the case and press them firmly together. Ensure all of the wires are inside the enclosure to prevent kinking any of the wires.&nbsp;

![raspberry_pi_close-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/115/medium640/raspberry_pi_close-case.jpg?1462222221)

![raspberry_pi_close-case-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/116/medium640/raspberry_pi_close-case-2.jpg?1462222249)

## Install Shoulder Actuators&nbsp;

The shoulder buttons printed in TPE filament is easy to install.&nbsp;Squeeze the actuator and press it into the openings. Hold the two halves together while&nbsp;installing the actuators to prevent the case from coming apart.

![raspberry_pi_install-shoulder-rubber-button.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/117/medium640/raspberry_pi_install-shoulder-rubber-button.jpg?1462222333)

![raspberry_pi_installed-rubber-button.jpg](https://cdn-learn.adafruit.com/assets/assets/000/032/118/medium640/raspberry_pi_installed-rubber-button.jpg?1462222347)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/119/medium800/raspberry_pi_final-build.jpg?1462222484)

## Final Build

Congratulations! You've finished building the&nbsp;PiGRRL Zero! Take a moment to test out all of the button acutators with a play test. If eveything works as expect, great! If not, please feel free to post any questions or concerns in the [Adafruit Forums](https://forums.adafruit.com/).

![](https://cdn-learn.adafruit.com/assets/assets/000/032/126/medium800/raspberry_pi_pigrrlzero-left.jpg?1462222875)

# PiGRRL Zero

## Usage & Extras

 **Please see notes on the “Software” page about expanding the filesystem to utilize&nbsp;the whole SD card. This is not done automatically.**

## PiTFT Buttons

The four buttons the PiTFT display are mapped to the following (start from left to right):

1. Exit - Escape (GPIO 17)
2. Select - Left Control (GPIO 22)
3. Start - Enter/Return (GPIO 23)
4. Not Mapped - 4 (GPIO 27)

## Connecting to WiFi

Before connecting a WiFi adapter, you'll want to use a USB hub so you can connect a USB keyboard necessary for typing your WiFi password. Then, connect a WiFi adapter into the USB hub.

Go to the RetroPie section in Emulation Station and choose "Configure WiFi". Select "1 Connect to WiFi network" with the Enter key. Use the up and down buttons of the DPad to&nbsp;highlight your network and the Enter key to choose. Type in your WiFi password and use the Enter key to submit. Your Pi's IP address will display in the top of the WiFi Menu. Choose "Cancel" using the Enter key to exit the "Configure WiFi" menu.

## Uploading ROMs

You'll need to get the Pi on your WiFi network in order to connect to it. Use your desktop computer&nbsp;and your prefered SFTP client to connect.

- IP Address - example: 10.1.10.XXX
- Username: pi
- Password: raspberry

Go to the following directory to upload ROMs

**/home/pi/RetroPie/roms**

Upload your ROMs to the proper emulator folder (ie. nes, snes, gb, etc.)

## USB Port

The USB port can be used to connect&nbsp;peripheral such as a USB hub, keyboard, WiFi, Bluetooth or audio adapter.

Info: 

## Audio&nbsp;Adapter

A USB Audio Adapter can be used to output audio. We suggest using the one linked in the BOM, as it's proven to work with the Raspberry Pi. There's no need to configure the audio since the ready-to-go PiGRRL Zero image has it preinstalled.&nbsp;

To change the audio output level, go to the "RetroPie" section in emulation station and select "Configure Audio Settings", then choose "4&nbsp;Mixer - adjust output volume" using the "enter / return" key (3rd button from left) on the PiTFT. From here, you can use the DPAD up or down &nbsp;buttons to adjust the audio levels. Press the "exit" button (far left button) on the PiTFT to save and exit "ALSA Mixer".

## Exiting a ROM/Game

To quit a game and go back to&nbsp;the Emulation Station screen, press and hold the "Start" and "Select" buttons at the same time.

# PiGRRL Zero

## RetroPie: Improving Emulator Performance

On **single-core** Raspberry Pi boards like the **Model A+** and **Pi Zero** , emulation speed is sometimes less than stellar…the screen may update like molasses, or sound may be choppy. Let’s look at some ideas to fight back…

**All of these methods require a USB keyboard attached.**

The directions shown here are for&nbsp; **RetroPie 4.1** , but the same general ideas apply to other versions and possibly even other emulation packages, the steps will just be different.

# Overclocking

Most Raspberry Pi boards can handle some _overclocking_ — running the processor slightly faster than its “official” speed. Too fast though, and the system can become unstable and crash. Due to manufacturing variances, every single board is slightly different in this regard…you’ll need to do some experimentation to find the fastest _reliable_ setting for your specific board. Restart after making any changes and **try running some games for several minutes** to really put the system through its paces.

You can access the **raspi-config** utility from the RetroPie configuration screen, or press “F4” to exit to a command line and run “sudo raspi-config” manually.

raspi-config is keyboard-based, mostly using the **arrows** and **enter** keys; arcade controls, if connected, probably won’t have the intended effect.

Different Pi models offer different overlock settings. On the Model B+ being tested here, the “Medium” setting seems quite reliable. Other board types may overclock automatically and there’s nothing to adjust here.

![gaming_retropie1.png](https://cdn-learn.adafruit.com/assets/assets/000/038/218/medium640/gaming_retropie1.png?1483738524)

![gaming_raspi-config.png](https://cdn-learn.adafruit.com/assets/assets/000/038/222/medium640/gaming_raspi-config.png?1483739046)

![gaming_overclock1.png](https://cdn-learn.adafruit.com/assets/assets/000/038/223/medium640/gaming_overclock1.png?1483739055)

![gaming_overclock2.png](https://cdn-learn.adafruit.com/assets/assets/000/038/224/medium640/gaming_overclock2.png?1483739066)

If you’re using a **PiTFT display** , the “core” frequency setting should **not exceed 300 MHz** ; the display will glitch and may not work at all. So avoid the higher overclock settings if using one of these screens, or manually edit the file /boot/config.txt to fine-tune&nbsp;various system frequencies individually.

# Choosing an Alternate Emulator
When launching a game, there’s a brief moment when it’s possible to access some launch options…

When you see this “launching” screen, press the space bar (or any other key that generates an actual keycode…not a “meta” key like shift or control).

This brings up a menu…similar to raspi-config, it operates with the keyboard, not arcade buttons.

The first option lets you select an alternate emulator program (if available). For example, RetroPie 4.1 includes two different NES emulators: lr-fceumm (the default) and lr-nestopia. Different emulators make tradeoffs with regard to performance and “accuracy” of the emulation. Try an alternative and see how it performs (use the “Launch” option).

The selection you make will “stick” — it is **not necessary to use this menu every time** , unless you want to switch back to the original emulator choice. There’s also an option to use an alternate emulator only for specific ROMs, if you have different needs for different games.

![gaming_mash.png](https://cdn-learn.adafruit.com/assets/assets/000/038/225/medium640/gaming_mash.png?1483739334)

![gaming_select1.png](https://cdn-learn.adafruit.com/assets/assets/000/038/226/medium640/gaming_select1.png?1483739357)

![gaming_select2.png](https://cdn-learn.adafruit.com/assets/assets/000/038/227/medium640/gaming_select2.png?1483739363)

![gaming_launch.png](https://cdn-learn.adafruit.com/assets/assets/000/038/228/medium640/gaming_launch.png?1483739377)

The above steps are fairly quick and easy. If they meet your needs, consider the job done! If it’s still not quite the performance you need, the situation gets more involved…

**These next steps _require_ a network connection.** On a Model A+ or Pi Zero, that usually requires a USB hub and an Ethernet or WiFi adapter, along with some configuration (the RetroPie 4.1 configuration menu includes WiFi setup). Alternately, if you have a spare Model B+ around, that’s easy to get on an Ethernet network…move the SD card over there for setup, then move it back to the target system when done.

# Installing Additional Emulators
Some “bleeding edge” emulators might offer better performance than the stock options provided by RetroPie. As with the “Alternate Emulators” above, it sometimes comes with a tradeoff in accuracy (hence their non-inclusion), so you’ll need to experiment and decide if it’s worth it.

From the RetroPie configuration screen, select “RetroPie Setup,” which switches to another of these keyboard-based menus.

Select “Manage packages,” then either “Manage optional packages” or “Manage experimental packages.” You’ll get a list of various emulators and/or games that aren’t normally installed by default. _lr-quicknes_ was an optional package for NES emulation…it’s faster than the others…_too_ fast, in fact, so I ended up not using it…but that’s all part of the experimentation process.

Choose the “ **Install from binary** ” option to install the selected package. Don’t bother with the “source” option…it’s _very_ time consuming and usually provides no benefit.

![gaming_retropie1.png](https://cdn-learn.adafruit.com/assets/assets/000/038/230/medium640/gaming_retropie1.png?1483739426)

![gaming_retropie2.png](https://cdn-learn.adafruit.com/assets/assets/000/038/232/medium640/gaming_retropie2.png?1483739441)

![gaming_manage.png](https://cdn-learn.adafruit.com/assets/assets/000/038/290/medium640/gaming_manage.png?1483746396)

![gaming_optional.png](https://cdn-learn.adafruit.com/assets/assets/000/038/291/medium640/gaming_optional.png?1483746412)

![gaming_quicknes.png](https://cdn-learn.adafruit.com/assets/assets/000/038/292/medium640/gaming_quicknes.png?1483746423)

![gaming_binary.png](https://cdn-learn.adafruit.com/assets/assets/000/038/293/medium640/gaming_binary.png?1483746430)

# Updating Emulators to Latest Versions

Sometimes you just need the newest-and-shiniest version of an installed emulator to provide the best available performance…

From the RetroPie configuration screen, select “RetroPie Setup.” This brings up the keyboard-driven menu again. Choose the “Update all installed packages” option to make a sweep through the system that’ll update _everything_ to the latest release, including the kernel.

**This system-wide update can be extremely time-consuming…possibly an hour or so, depending on processor and network speeds.**

Even the default lr-fceumm on a non-overclocked Pi ran great after updating!

**If using a PiTFT display, think twice before trying this option.** Perhaps make a **backup** of your SD card first. Kernel updates have been known to break PiTFT support in some circumstances, and you’d have to start all over.

![gaming_retropie1.png](https://cdn-learn.adafruit.com/assets/assets/000/038/238/medium640/gaming_retropie1.png?1483739487)

![gaming_retropie2.png](https://cdn-learn.adafruit.com/assets/assets/000/038/239/medium640/gaming_retropie2.png?1483739502)

![gaming_updateall.png](https://cdn-learn.adafruit.com/assets/assets/000/038/240/medium640/gaming_updateall.png?1483739522)

# PiGRRL Zero

## Troubleshooting RetroPie and retrogame

This page documents the most common pitfalls encountered when making retro gaming&nbsp;projects, offering&nbsp;some solutions and where to turn for further help.

There are some things we can fix and some we can’t…we’re not involved in RetroPie’s development, for example…but we’ll try to point you in the right direction.

Most of the following&nbsp;troubleshooting steps will require a&nbsp; **USB keyboard attached**. Some require a&nbsp; **network connection**.

# General&nbsp;Troubleshooting

**There’s a lightning bolt icon in the upper right part of the screen!**

- That icon means the Raspberry Pi isn’t receiving adequate power; most likely, you need a higher current power supply. Very occasionally this is caused by a flimsy USB cable with thin wires…try swapping out for something heftier.

# _retrogame_ Related Troubleshooting

**_retrogame_** is our software that converts GPIO button actions&nbsp;into keyboard events. **These are the problems we’re best equipped to fix.**

Some common things to check for any _retrogame_ installation:

- Confirm button/joystick wires go to the correct pins and to ground. A multimeter with a continuity beep function is helpful for testing.
- The retrogame configuration file ( **/boot/retrogame.cfg** )&nbsp;uses _Broadcom pin numbers_…these are **_not_** sequential along the GPIO header pins. [This site has a nice reference chart](https://pinout.xyz) (use the “BCM” numbers).
- Earlier versions of _retrogame_ didn’t use a configuration file…you had to edit and compile the source code. That’s just horrible. If you’re running an early version like that, this would be a good time to upgrade. See the [Installing Retrogame](../../../../retro-gaming-with-raspberry-pi/adding-controls-software) page.

### 

- Check connections and configuration file pin numbers as explained above. (If some controls are responding, that’s an encouraging start…it at least means the code is running.)
- The key codes generated by retrogame might not be assigned to EmulationStation’s keyboard inputs; one or the other will need to be changed. Either edit /boot/retrogame.cfg, or, from the EmulationStation main screen, press Start to access the main menu, then select “Configure Input” and proceed through each of the controls.

### 

- Confirm that retrogame is actually running…either exit to the command line (F4) or log in using ssh, then&nbsp;use “ps -ef | grep retrogame” to check. If you used our installer script or one of our ready-made SD card images, it should be started automatically on boot (added to /etc/rc.local).
- Confirm that the file “/etc/udev/rules.d/10-retrogame.rules” exists. Our installer script creates this file, but if you installed retrogame manually or from source, it may have been overlooked.

### 

Confirm that the file “/etc/udev/rules.d/10-retrogame.rules” exists. Our installer script creates this file, but if you installed retrogame manually or from source, it may have been overlooked.

### 

Unfortunately, yes. retrogame only works with “passive” switches between a GPIO pin and ground (logic low=pressed). It won’t work with switches that have the opposite logic level (high=pressed).

### 

This can happen if you’re running an early Raspberry Pi (Model A or B) with the 26-pin GPIO header and select the “Six buttons + joystick” option in the retrogame installer. That particular configuration is set up for our Arcade Pack and newer (40 pin) Raspberry Pi boards. Some of the pin numbers referenced&nbsp;_don’t exist_ on the older 26-pin header and lead to trouble.

If this happens to you, not to worry. Power off the Pi and insert the SD card in a reader on a PC or Mac. Look for a file called retrogame.cfg…edit this file and change the pin numbers to match your specific controller wiring.

# _RetroPie_ Related Troubleshooting

RetroPie provides the actual emulation software and a nice user interface. As this is third-party code, the “depth” of problems we can troubleshoot is more limited, but here are some of the common issues we’ve seen and how to resolve them…

### 

This can happen with certain&nbsp;emulators (usually older or more esoteric ones) that don’t use the _libretro_ library. Among other things, libretro allows the global controller configuration to be used everywhere. There are a couple of workarounds that _might_ help, but no guarantees…

- You can rummage around in&nbsp;/opt/retropie/configs and look for a configuration file specific to the problem&nbsp;emulator, then edit its keyboard layout to match your controls. The format of this file, if one even exists, is likely specific to that one emulator, so you’ll need to do some research (Google search, etc.), it’s not something we can help out with.
- You can try hunting&nbsp;for an alternate emulator based on libretro, if there’s one available (see “Installing RetroPie Packages” below).

### 

This can happen if the ROM file format changes between versions of an emulator, or if two emulators for the same system use different formats.

- Do some research (Google search, etc.) to see if this is the case. It’s possible there may be utilities to convert among different ROM formats.
- Try installing an alternate emulator, if there’s one available (see “Installing RetroPie Packages” below).

A few&nbsp;emulators may require a “BIOS file” in order to function, but it’s not included with the software for legal reasons. This is something you’ll have to research and track down.

## Installing RetroPie Packages
To add support for a system not present in RetroPie by default, or to add&nbsp;an alternate emulator program for an existing system, select “RetroPie Setup” from the RetroPie menu. **This brings up a text-menu-based interface and will require a USB keyboard to navigate.**

Select “Manage packages” and then one of the core, main, optional or experimental selections…you’ll probably want to navigate through each of them to see what’s available, keeping in mind that each successive category might be a little rougher around the edges.

**Your best bet are packages whose names begin with “lr-”.** This means they’re built using **libretro** and the control inputs should already work with what you have! Other packages may require their own manual controller setup, which can be a real nuisance.

When asked, select “ **Install from binary**.” The _source_ option takes _much_ longer and won’t provide any&nbsp;benefit for the average user…only attempt that if you _know_ you need absolutely bleeding-edge code.

It’s totally valid to install multiple emulator packages that handle the same type of system. Each might have different performance or compatibility benefits, so it’s worth testing your options. See “Accessing Alternate Emulators” below.

![gaming_setup1.png](https://cdn-learn.adafruit.com/assets/assets/000/039/992/medium640/gaming_setup1.png?1489035401)

![gaming_setup2.png](https://cdn-learn.adafruit.com/assets/assets/000/039/993/medium640/gaming_setup2.png?1489035467)

![gaming_setup3.png](https://cdn-learn.adafruit.com/assets/assets/000/039/994/medium640/gaming_setup3.png?1489035472)

![gaming_setup4.png](https://cdn-learn.adafruit.com/assets/assets/000/039/995/medium640/gaming_setup4.png?1489035479)

![gaming_setup5.png](https://cdn-learn.adafruit.com/assets/assets/000/039/996/medium640/gaming_setup5.png?1489035485)

## Accessing Alternate Emulators
When you launch a game, you’ll briefly see this nondescript launching message. **You have a couple of seconds to hit a button or key…**

The first option in this configuration menu lets you select a different emulator package for a given system type…or even on an individual ROM-by-ROM basis, if different games benefit from different emulation software.

Test it out with. If you don’t like the results, next time you launch that game you can access the configuration menu again and restore the original selection.

![gaming_config1.png](https://cdn-learn.adafruit.com/assets/assets/000/039/990/medium640/gaming_config1.png?1489035260)

![gaming_menu1.png](https://cdn-learn.adafruit.com/assets/assets/000/039/991/medium640/gaming_menu1.png?1489035287)

## More RetroPie Help

For issues not covered above, the best sources for RetroPie-specific help are the official&nbsp;documentation and forum on the RetroPie web site:

**[RetroPie Documentation](https://retropie.org.uk/docs/)**

**[RetroPie Forum](https://retropie.org.uk/forum/)**


## Featured Products

### Adafruit PiTFT 2.2" HAT Mini Kit - 320x240 2.2" TFT - No Touch

[Adafruit PiTFT 2.2" HAT Mini Kit - 320x240 2.2" TFT - No Touch](https://www.adafruit.com/product/2315)
The cute PiTFT got even more adorable with this little primary display for Raspberry Pi in HAT form! It features a 2.2" display with 320x240 16-bit color pixels. The HAT uses the high-speed SPI interface on the Pi and can use the mini display as a console, X window port, displaying images...

In Stock
[Buy Now](https://www.adafruit.com/product/2315)
[Related Guides to the Product](https://learn.adafruit.com/products/2315/guides)
### Raspberry Pi Zero - Version 1.3

[Raspberry Pi Zero - Version 1.3](https://www.adafruit.com/product/2885)
At first glance, the Pi Zero isn't much. &nbsp;It just looks like a slimmed down version of the Raspberry Pi we know and love. &nbsp;But when we started to think of the possibilities - [and what a well-chosen set of accessories could add](https://www.adafruit.com/product/2816) -...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2885)
[Related Guides to the Product](https://learn.adafruit.com/products/2885/guides)
### PiGrrl Zero Custom Gamepad PCB

[PiGrrl Zero Custom Gamepad PCB](https://www.adafruit.com/product/2934)
This is the custom **Gamepad PCB for the&nbsp;[PiGRRL Zero Parts Kit](https://www.adafruit.com/products/3161)!&nbsp;**

We've dramatically cut the build time in half of the PiGRRL Zero pack by making this&nbsp;custom gamepad PCB....

In Stock
[Buy Now](https://www.adafruit.com/product/2934)
[Related Guides to the Product](https://learn.adafruit.com/products/2934/guides)
### PowerBoost 1000 Charger - Rechargeable 5V Lipo USB Boost @ 1A

[PowerBoost 1000 Charger - Rechargeable 5V Lipo USB Boost @ 1A](https://www.adafruit.com/product/2465)
PowerBoost 1000C is the perfect power supply for your portable project!&nbsp; **With a built-in load-sharing battery charger circuit, you'll be able to keep your power-hungry project running even while recharging the battery!** &nbsp;This little DC/DC boost converter module can...

In Stock
[Buy Now](https://www.adafruit.com/product/2465)
[Related Guides to the Product](https://learn.adafruit.com/products/2465/guides)
### Lithium Ion Battery - 3.7V 2000mAh

[Lithium Ion Battery - 3.7V 2000mAh](https://www.adafruit.com/product/2011)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 2000mAh. If you need a larger (or smaller!) battery,&nbsp;<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/2011)
[Related Guides to the Product](https://learn.adafruit.com/products/2011/guides)
### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

In Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
### Tactile Button switch (6mm) x 20 pack

[Tactile Button switch (6mm) x 20 pack](https://www.adafruit.com/product/367)
Little clicky switches are standard input "buttons" on electronic projects. These work best in a PCB but [can be used on a solderless breadboard as shown in this tutorial](https://learn.adafruit.com/adafruit-arduino-lesson-6-digital-inputs?view=all). The pins are normally...

In Stock
[Buy Now](https://www.adafruit.com/product/367)
[Related Guides to the Product](https://learn.adafruit.com/products/367/guides)
### Tiny OTG Adapter - USB Micro to USB

[Tiny OTG Adapter - USB Micro to USB](https://www.adafruit.com/product/2910)
This super slim, super tiny, and super cute Micro-B&nbsp;to USB on-the-go adapter is so slim, tiny, and cute that we'd pinch its cheeks if it was big enough to have cheeks. &nbsp;At just ~15.5mm long, ~11.3mm wide, and ~2mm, this really is the tiniest little adapter we've probably ever...

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

## Related Guides

- [Adafruit Powerboost 1000C](https://learn.adafruit.com/adafruit-powerboost-1000c-load-share-usb-charge-boost.md)
- [Retro Gaming with Raspberry Pi](https://learn.adafruit.com/retro-gaming-with-raspberry-pi.md)
- [CRICKIT Snake Bot](https://learn.adafruit.com/crickit-snake-bot.md)
- [CRICKIT Flippy Robot](https://learn.adafruit.com/crickit-flippy-robot.md)
- [Overwatch Prop Gun: Lucio's Blaster Pt. 1](https://learn.adafruit.com/overwatch-lucio-gun-pt1.md)
- [Pathfinder Robot Companion](https://learn.adafruit.com/pathfinder.md)
- [CRICKIT WobblyBot](https://learn.adafruit.com/crickit-wobblybot.md)
- [PyPortal View Master](https://learn.adafruit.com/pyportal-view-master.md)
- [Running OpenGL-based Games & Emulators on Adafruit PiTFT Displays](https://learn.adafruit.com/running-opengl-based-games-and-emulators-on-adafruit-pitft-displays.md)
- [PyPortal Roku Remote](https://learn.adafruit.com/pyportal-roku-remote.md)
- [Overwatch Prop Gun: Lucio's Blaster Pt. 2](https://learn.adafruit.com/overwatch-lucio-gun-pt-2.md)
- [7" Portable HDMI Monitor](https://learn.adafruit.com/7-hdmi-portable-monitor.md)
- [Printy Boost: Reimagining a Classic Adafruit Kit](https://learn.adafruit.com/printy-boost-reimagining-a-classic-adafruit-kit.md)
- [PiGRRL 2](https://learn.adafruit.com/pigrrl-2.md)
- [Portable 5in Monitor with HDMI](https://learn.adafruit.com/portable-5in-monitor-with-hdmi.md)
