# Mini Pinball Table with Gemma M0

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/046/066/medium800/gaming_P9020255_2k.jpg?1504620547)

It's a lot of fun to play virtual pinball on an iPad! My favorite game is&nbsp;_Pinball Arcade&nbsp;_which features excellent physics and a huge host of classic table reproductions, from "Aadams Family Pinball" to "Theatre of Magic" and more. But, playing with the virtual, screen-tapping controls isn't as satisfying as hitting real flipper buttons. Let's solve that!

This Mini Pinball Table is pretty straightforward to build, using slotted aluminum extrusion and hardware. And, the circuit to make it all go is really easy to make -- it requires no soldering, just plug&nbsp;wires and clip&nbsp;alligator clips to the buttons and a Gemma M0 microcontroller, which takes care of the rest!

Info: 

https://youtu.be/4DtqZFT_7UQ

![](https://cdn-learn.adafruit.com/assets/assets/000/046/067/medium800/gaming_P9010003_2k.jpg?1504620928)

## Control Parts

Listed below&nbsp;are the parts you'll need to make the controller

![](https://cdn-learn.adafruit.com/assets/assets/000/046/069/medium800/gaming_P9010007_2k.jpg?1504621260)

Purple: Note that since this guide was published, several Adafruit parts used to make this project are no longer stocked. You can likely find equivalents in hobby shops or online. You may also consider using wood or 3D printing which is much more common these days.

### Part: Adafruit Gemma M0
quantity: 1
Miniature wearable electronics microcontroller platform
[Adafruit Gemma M0](https://www.adafruit.com/product/3501)

### Part: Arcade Button - 30mm 
quantity: 2
You'll need two buttons for the flippers, get them in any colors you like!
[Arcade Button - 30mm ](https://www.adafruit.com/product/476)

### Part: Arcade Button with LED - 30mm
quantity: 1
This one's for the plunger
[Arcade Button with LED - 30mm](https://www.adafruit.com/product/3490)

### Part: Arcade/Button Quick-Connect Wire Pair - Set of 10 pairs
quantity: 1
For simple button wiring
[Arcade/Button Quick-Connect Wire Pair - Set of 10 pairs](https://www.adafruit.com/product/1152)

### Part: Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces
quantity: 1
To make connections between the button wiring and the Gemma M0 -- no soldering required!
[Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces](https://www.adafruit.com/product/3225)

### Part: Short Wire Alligator Clip Test Leads (set of 12)
quantity: 1
You'll use these to connect buttons to common ground
[Short Wire Alligator Clip Test Leads (set of 12)](https://www.adafruit.com/product/1592)

### Part: USB cable - 6" A/MicroB
quantity: 1
Micro USB cable to connect the Gemma M0 to the USB-to-Lightning adapter 
[USB cable - 6" A/MicroB](https://www.adafruit.com/product/898)

Info: 

## Table Materials

These are the parts used to build the aluminum table:

![](https://cdn-learn.adafruit.com/assets/assets/000/046/068/medium800/gaming_P9010090_2k.jpg?1504621174)

### Part: Slotted Aluminum Extrusion - 20mm x 20mm - 610mm long
quantity: 3
Slotted aluminum extrusions
[Slotted Aluminum Extrusion - 20mm x 20mm - 610mm long](https://www.adafruit.com/product/1221)

### Part: L-Plate for 2020 Aluminum Extrusion
quantity: 8
L-plates for corner attachments, flipper button holders
[L-Plate for 2020 Aluminum Extrusion](https://www.adafruit.com/product/1218)

### Part: Aluminum Extrusion Double Corner Brace Support
quantity: 4
Corner braces
[Aluminum Extrusion Double Corner Brace Support](https://www.adafruit.com/product/1259)

### Part: Plastic Hinge for 20x20 Aluminum Extrusion
quantity: 1
Hinge for mounting the Gemma M0
[Plastic Hinge for 20x20 Aluminum Extrusion](https://www.adafruit.com/product/1215)

### Part: Button Hex Machine Screw - M4 thread - 10mm long - pack of 50
quantity: 1
Screws to hold things together
[Button Hex Machine Screw - M4 thread - 10mm long - pack of 50](https://www.adafruit.com/product/1159)

### Part: Aluminum Extrusion Slim T-Nut for 20x20 - M4 Thread - pack of 50
quantity: 1
Easy to use T-nuts -- don't need to slide in from the ends!
[Aluminum Extrusion Slim T-Nut for 20x20 - M4 Thread - pack of 50](https://www.adafruit.com/product/1157)

### Part: Hex Key/Allen Wrench 2.5mm
quantity: 1
 For driving the M4 screws
[Hex Key/Allen Wrench 2.5mm](https://www.adafruit.com/product/1229)

### Part: Aluminum Extrusion End Caps - pack of 10
quantity: 1
These act as feet for a non-scratch finish on the legs
[Aluminum Extrusion End Caps - pack of 10](https://www.adafruit.com/product/1156)

Additional Parts

You'll also need:

- iPad or iPhone and a copy of The Pinball Arcade or other iCade compatible game
- an adapter for the iOS device to connect USB to the Lightning port, such as the&nbsp;[Apple USB to Lightning Camera Adapter.](https://www.apple.com/shop/product/MD821AM/A/lightning-to-usb-camera-adapter)&nbsp;&nbsp;(If you have an older iPad or iPhone you will need the&nbsp;30-pin dock connector&nbsp;version of the camera kit)

![](https://cdn-learn.adafruit.com/assets/assets/000/046/001/medium800/gaming_ipadCam.jpeg?1504300456)

## Tools

The only tools you'll need are the 2.5mm hex driver for the screws, and a hack saw and miter box or other tool (band saw, miter saw with metal cutting blade, Dremel, die grinder, etc.) to cut the lengths of aluminum extrusion.

Most cuts are at a 90 degree angle, but the four feet ends on the legs will be cut at an 87 degree angle to give the table it's signature tilt.

Next, let's program the Gemma M0 to turn button presses into keyboard commands!

# Mini Pinball Table with Gemma M0

## Code the Gemma M0 with CircuitPython

## Gemma M0

The Gemma M0 is just right for this project for a few reasons.&nbsp;It's inexpensive, has three digital input pins to read the two flippers and the plunger, it can output HID USB keyboard strokes over USB, and it draws very little power, so the iPad and iPhone won't mind powering it! Plus, it has an RGB DotStar LED that can be used as a multi-color indicator!

## Coding Options

The Gemma M0 can currently be coded with either&nbsp;the Arduino IDE or&nbsp;CircuitPython. For this project, we'll use CircuitPython. It's very simple to set up -- all you need to do is plug it into your computer via USB and it shows up as a USB thumb drive. Then, you can write code in any text editor and save the file to the Gemma M0. That's all it takes, it immediately runs the code. Talk about fast iteration!

## iCade Standard
Since the iPad doesn't have a game controller port on it like a video game console, game developers have come up with a few clever ways to interface physical controls with the device. One such standard is the&nbsp;[iCade](https://en.wikipedia.org/wiki/ICade)&nbsp;protocol, made by ION Audio for their line of iPad desktop arcade cabinets and controllers.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/046/070/medium800/gaming_ION_iCade.jpg?1504623921)

The iCade standard interfaces with iOS&nbsp;as an HID keyboard, and&nbsp;is typically&nbsp;paired over Bluetooth. However, plugging in a wired HID keyboard works just as well, which makes it very straightforward to build your own controller!

The Gemma M0 is going to act as a USB HID keyboard so that it can "type" the keystrokes that the iCade standard uses.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/071/medium800/gaming_icade02.png?1504624264)

Here's what the button mapping looks like for the standard iCade:

![](https://cdn-learn.adafruit.com/assets/assets/000/046/072/medium800/gaming_icade03.png?1504624289)

## Keyboard Mapping

The first test I performed was&nbsp;to figure out the key mappings needed. I did so by pairing a Bluetooth keyboard to the iPad, launching_&nbsp;Pinball Arcade,&nbsp;_and setting the controller type to iCade in the game's settings. Then, I typed the key pairs seen in the diagram above until I knew which key combos&nbsp;did what.

The mapping for pinball looks like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/046/073/medium800/gaming_icade04.jpg?1504624330)

## Test Code

The next&nbsp;test I did was to have the Gemma M0&nbsp;press&nbsp;the flipper buttons by telling it to "type" the "LVHR" combo over and over. Here's how you can make&nbsp;the Gemma M0&nbsp;type the keystrokes.

First, make sure you've followed the [basic guide to setting up the Gemma M0](../../../../adafruit-gemma-m0). Once you've successfully run&nbsp;the [basic Blinky code example](../../../../adafruit-gemma-m0/circuitpython-blinky)&nbsp;on&nbsp;your Gemma M0, move on to the next step.

Primary: 

The Gemma M0 ships with all of the libraries we'll need (HID library and DotStar library) already installed on the board, so we can immediately start coding this example!

With the Gemma M0 plugged into your computer, open the **CIRCUTPY** drive that shows up, and edit the **code.py** &nbsp;(or **main.py,** &nbsp;either will work) **&nbsp;** file in your text editor.

Copy and paste the code below into your text editor and then save the file, overwriting the existing **code.py** file on the root of the Gemma M0. Be careful where your cursor is when you save, since the program will cause the Gemma M0 to start spewing the letters "lhvr" as if you were banging on your keyboard!

If you want to test it out on your pinball game, go ahead and plug the Gemma M0 into the iPad using the USB to Lightning adapter. The iPad will autodetect the device and open a camera import window. You can ignore this and switch to your iCade compatible pinball game, such as _Pinball Arcade.&nbsp;_When you start a new game, it will immediately begin flipping the flippers for you automatically! Launch a ball onto the field with the on-screen plunger and watch it play by itself for a bit!

## Button Code

Now it's time to rewrite the code so that the two flippers and the plunger aren't haunted by the ghost of Tommy, but instead, respond to your arcade buttons.

## Download the Project Bundle

Your project will use a specific set of CircuitPython libraries and the&nbsp; **code.py** &nbsp;file. In order to get the libraries you need, click on the&nbsp; **Download Project Bundle** &nbsp;link below, and uncompress the .zip file.

Drag the contents of the uncompressed bundle directory onto your Gemma M0 board's **CIRCUITPY** &nbsp;drive, with the exception of the **adafruit\_hid** library (see next section on that) replacing any existing files or directories with the same names, and adding any new ones that are necessary.

## Library Pruning

You may run out of space on the Gemma M0 if you copy the entire adafruit\_hid library over -- but you only need a few files, as shown on the left.

Delete unnecessary files from that folder before copying it over to the Gemma M0.

![gaming_pinballlib.jpg](https://cdn-learn.adafruit.com/assets/assets/000/111/716/medium640/gaming_pinballlib.jpg?1652544677)

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Gemma/GemmaM0_Pinball/code.py

Next, we'll connect the arcade buttons to the Gemma M0.

# Mini Pinball Table with Gemma M0

## Connect the Arcade Buttons

![](https://cdn-learn.adafruit.com/assets/assets/000/046/075/medium800/gaming_iCadePinballGemmaM0.jpg?1504629102)

Info: 

Using the diagram above, you can see how the three buttons will be connected. Since all buttons need to share a common ground with the Gemma M0, but we only have one available GND pad, we'll run ground to a terminal on one button (it doesn't matter which terminal) and then connect the rest of the buttons to that terminal.

You can try this arrangement out right away with the short alligator clip leads, or use the longer arcade button quick connect wire pairs and alligator clip to male jumper wires for the greater length we'll need in the final table as shown below.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/076/medium800/gaming_P9010007_2k.jpg?1504629375)

To begin, connect the terminals of each wire pair to the lugs on the buttons.

**Note:** &nbsp;on the larger, threaded button with internal LED (which we won't be using), we'll connect only to the switch lugs which come out of the grey switch box, not the LED pair set deeper into the button housing.

![gaming_P9010009_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/077/medium640/gaming_P9010009_2k.jpg?1504629431)

![gaming_P9010010_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/078/medium640/gaming_P9010010_2k.jpg?1504629439)

![gaming_P9010011_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/079/medium640/gaming_P9010011_2k.jpg?1504629447)

Next, connect the ground wires as shown here using the black short alligator clip leads.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/080/medium800/gaming_P9010013_2k.jpg?1504629634)

Connect the four wires extensions ( **black** to **GND** , **yellow** to **D1** , **blue** to **D2,** and **white** to **D0** )&nbsp;to the alligator clip leads with male pins as shown here, being careful to connect to the&nbsp;correct leads, not the ground sides which will remain unused.

![gaming_P9010015_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/081/medium640/gaming_P9010015_2k.jpg?1504629737)

![gaming_P9010016_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/082/medium640/gaming_P9010016_2k.jpg?1504629744)

![gaming_P9010017_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/083/medium640/gaming_P9010017_2k.jpg?1504629751)

This is how the final wiring will look.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/084/medium800/gaming_P9010019_2k.jpg?1504629841)

Plug in the Gemma M0 to power, and you can test out the buttons. The built-in DotStar is an RGB LED, and it make for a pretty handy indicator light. The code will light the DotStar to the same color as the button pressed as a handy way to check that everything is wired properly. Plus, it adds a bit of a fun light show while you're playing!

![](https://cdn-learn.adafruit.com/assets/assets/000/046/085/medium800thumb/gaming_buttonLight.jpg?1504633196)

Now, you can try it out on your iPad (or iPhone as shown here). Plug the Gemma M0 into the short USB cable and then into the USB-to-Lightning adapter and into the iOS device. The camera import screen may pop up, you can ignore it and hit the home button. Then launch the Notes app and press the buttons to type the keystrokes.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/086/medium800/gaming_P9010027_2k.jpg?1504633699)

![](https://cdn-learn.adafruit.com/assets/assets/000/046/087/medium800thumb/gaming_buttonType.jpg?1504633722)

OK, enough anticipation, launch the _Pinball Arcade_ game and in the settings, click the iCade button until it reads "iCade:iPad". Then, launch a table, and test out your buttons!

![](https://cdn-learn.adafruit.com/assets/assets/000/046/088/medium800thumb/gaming_buttonPlay.jpg?1504634511)

# Mini Pinball Table with Gemma M0

## Assemble the Aluminum Table

![](https://cdn-learn.adafruit.com/assets/assets/000/046/089/medium800/gaming_P9020261_2k.jpg?1504636310)

Now we get to build the table! This part is fun, sort of like building a kit, except you'll need to do a little bit of cutting to create the proper lengths of aluminum extrusion.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/090/medium800/gaming_P9010090_2k.jpg?1504636643)

## Cutlist

First, take one of the lengths of aluminum extrusion and measure, mark, and cut the two frame sides from it, each at 300mm.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/092/medium800/gaming_P9010109_2k_label.jpg?1504637360)

Measure, then scribe a mark into the aluminum with a sharp tool or knife.

![gaming_P9010096_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/097/medium640/gaming_P9010096_2k.jpg?1504637723)

![gaming_P9010097_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/098/medium640/gaming_P9010097_2k.jpg?1504637731)

![gaming_P9010099_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/099/medium640/gaming_P9010099_2k.jpg?1504637739)

- Clamp the work into your miter box or fence of a miter saw
- You can use a lubricant to keep the blade and work cool
- Carefully cut the piece
- File off any rough edges if needed

![gaming_P9010100_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/100/medium640/gaming_P9010100_2k.jpg?1504637770)

![gaming_P9010101_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/101/medium640/gaming_P9010101_2k.jpg?1504637969)

![gaming_P9010103_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/103/medium640/gaming_P9010103_2k.jpg?1504638059)

![gaming_P9010104_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/104/medium640/gaming_P9010104_2k.jpg?1504638075)

Info: 

Next, cut the frame front&nbsp;and rear&nbsp;lengths to 197mm, also from a single 610mm length of stock.

This will leave enough remaining material to cut one of the rear legs, as well, which is 127mm, however, this one will have&nbsp;an 3&nbsp;degree angled cut for the foot. So, set your miter angle to 3 degrees with the blade cutting the longest leg of the angle to 127mm.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/105/medium800/gaming_P9010105_2k.jpg?1504638305)

Here we can see the angled cut next to a straight cut.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/106/medium800/gaming_P9010107_2k.jpg?1504638351)

You can place the plastic end caps on the angled feet as well as the rear frame lengths.

Make the remaining cuts in the third piece of stock to create the other 127mm rear leg and both of the 102mm front legs. All legs will have the 3 degree cut to one end.

![](https://cdn-learn.adafruit.com/assets/assets/000/046/107/medium800/gaming_P9010108_2k.jpg?1504638408)

## Assembly

&nbsp;Now we get to put it all together!&nbsp;Follow the photo sections below as your guide.

## Front Rail and Plunger Button

&nbsp;

- The plunger button will connect to the front rail using two double corner brace supports.&nbsp;
- Screw in two&nbsp;T-nuts on each bracket as shown here.
- Loosely attach them to the front rail, then fit them tightly to the plunger button, with the button's plastic nut helping hold it in place.
- Tighten down all four screws.

![gaming_P9010113_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/108/medium640/gaming_P9010113_2k.jpg?1504638753)

![gaming_P9010114_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/109/medium640/gaming_P9010114_2k.jpg?1504638760)

![gaming_P9010115_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/110/medium640/gaming_P9010115_2k.jpg?1504638769)

![gaming_P9010116_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/111/medium640/gaming_P9010116_2k.jpg?1504638781)

![gaming_P9010117_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/112/medium640/gaming_P9010117_2k.jpg?1504638789)

![gaming_P9010119_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/113/medium640/gaming_P9010119_2k.jpg?1504638797)

![gaming_P9010121_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/114/medium640/gaming_P9010121_2k.jpg?1504638804)

![gaming_P9010125_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/115/medium640/gaming_P9010125_2k.jpg?1504638815)

![gaming_P9010126_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/116/medium640/gaming_P9010126_2k.jpg?1504638823)

## Side Flipper Buttons

&nbsp;

- Screw in two L-plates to the left rail making space for the left flipper button (Note the two extra screws in the forward plate which will be used to connect the front left leg later)
- Overhang the front-most plate by 20mm, enough to over the front rail later
- Hold the plates firmly&nbsp;against the button's catch tabs and then tighten the screws&nbsp;
- Repeat for the right side flipper button

![gaming_P9010138_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/117/medium640/gaming_P9010138_2k.jpg?1504639102)

![gaming_P9010141_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/118/medium640/gaming_P9010141_2k.jpg?1504639119)

![gaming_P9010143_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/119/medium640/gaming_P9010143_2k.jpg?1504639133)

![gaming_P9010144_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/120/medium640/gaming_P9010144_2k.jpg?1504639151)

![gaming_P9010128_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/122/medium640/gaming_P9010128_2k.jpg?1504639226)

![gaming_P9010146_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/123/medium640/gaming_P9010146_2k.jpg?1504639241)

![gaming_P9010149_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/124/medium640/gaming_P9010149_2k.jpg?1504639268)

## Front Rail Connection to Side Rails

&nbsp;

- Prepare two more L-plates with screws and T-nuts
- Connect the front rail to the right rail as shown
- Make sure everything is nice and square, then connect the front rail to the left rail as shown

![gaming_P9010150_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/125/medium640/gaming_P9010150_2k.jpg?1504639399)

![gaming_P9010151_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/126/medium640/gaming_P9010151_2k.jpg?1504639412)

![gaming_P9010152_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/127/medium640/gaming_P9010152_2k.jpg?1504639420)

![gaming_P9010154_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/128/medium640/gaming_P9010154_2k.jpg?1504639427)

![gaming_P9010155_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/129/medium640/gaming_P9010155_2k.jpg?1504639437)

![gaming_P9010157_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/130/medium640/gaming_P9010157_2k.jpg?1504639448)

![gaming_P9010159_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/131/medium640/gaming_P9010159_2k.jpg?1504639522)

## Front Leg Attachment

- The front legs slide into the the two T-nuts that were already prepped on the L-plates
- Make sure the foot angles are correct -- the table will have a forward lean to it
- Set the legs up square to the undersides of the side rails, then screw down the screws
- Repeat for both sides

![gaming_P9010160_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/132/medium640/gaming_P9010160_2k.jpg?1504639683)

![gaming_P9010162_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/133/medium640/gaming_P9010162_2k.jpg?1504639689)

![gaming_P9010163_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/134/medium640/gaming_P9010163_2k.jpg?1504639697)

![gaming_P9010164_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/135/medium640/gaming_P9010164_2k.jpg?1504639706)

![gaming_P9010165_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/136/medium640/gaming_P9010165_2k.jpg?1504639714)

![gaming_P9010168_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/137/medium640/gaming_P9010168_2k.jpg?1504639732)

![gaming_P9010169_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/138/medium640/gaming_P9010169_2k.jpg?1504639743)

![gaming_P9010170_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/139/medium640/gaming_P9010170_2k.jpg?1504639764)

## Rear Leg Attachment

&nbsp;

- Prep two double corner brace supports, each with four screws and T-nuts
- Attach one of the brackets to the underside of the right side rail as shown, leaving 20mm of space for the leg to sit flush
- Again, being mindful of the foot angle that will allow for the table to lean properly, connect the right rear leg
- Tighten the screws, making sure everything's square
- Repeat these steps for the other rear leg

![gaming_P9010171_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/140/medium640/gaming_P9010171_2k.jpg?1504639902)

![gaming_P9010172_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/141/medium640/gaming_P9010172_2k.jpg?1504639909)

![gaming_P9020216_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/142/medium640/gaming_P9020216_2k.jpg?1504639977)

![gaming_P9020217_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/143/medium640/gaming_P9020217_2k.jpg?1504640017)

![gaming_P9020218_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/144/medium640/gaming_P9020218_2k.jpg?1504640024)

![gaming_P9020219_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/145/medium640/gaming_P9020219_2k.jpg?1504640031)

![gaming_P9020220_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/146/medium640/gaming_P9020220_2k.jpg?1504640070)

![gaming_P9020221_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/147/medium640/gaming_P9020221_2k.jpg?1504640077)

![gaming_P9020222_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/148/medium640/gaming_P9020222_2k.jpg?1504640086)

## Rear Frame Supports

&nbsp;

- Use two more L-plates to form supports that will hold the rear frame rail
- This will allow for an easier time inserting and removing the iPad
- Note the position of the single screw and T-nut inserted from the underside of each&nbsp;plate, this will be used to connect&nbsp;the rear frame&nbsp;rail later (it does not need to be inserted just yet, and doesn't appear in all photos)

![gaming_P9020224_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/149/medium640/gaming_P9020224_2k.jpg?1504640246)

![gaming_P9020229_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/150/medium640/gaming_P9020229_2k.jpg?1504640365)

## Gemma M0 Mount

&nbsp;

- Connect the Gemma M0 as shown to the plastic hinge using M2.5 nylon screws and standoffs or nuts
- The best orientation for screw clearance is to have the Gemma M0 on the side of the plastic hinge with the smaller hole diameter, not the counter-sink side
- Attach the plastic hinge/mount to the top rail with two screws and T-nuts

![gaming_P9010187_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/151/medium640/gaming_P9010187_2k.jpg?1504640575)

![gaming_P9010189_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/152/medium640/gaming_P9010189_2k.jpg?1504640583)

![gaming_P9010193_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/153/medium640/gaming_P9010193_2k.jpg?1504640596)

![gaming_P9010195_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/154/medium640/gaming_P9010195_2k.jpg?1504640658)

![gaming_P9010197_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/155/medium640/gaming_P9010197_2k.jpg?1504640681)

Insert iPad and Close it Up

&nbsp;

- Slide the iPad into the frame, keeping the Lighting port at the top/rear of the table
- Use two screws and T-nuts from the underside of the L-plates to attach the rear rail/Gemma M0 mount

![gaming_P9020230_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/156/medium640/gaming_P9020230_2k.jpg?1504640784)

![gaming_P9020231_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/157/medium640/gaming_P9020231_2k.jpg?1504640795)

![gaming_P9020232_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/158/medium640/gaming_P9020232_2k.jpg?1504640802)

![gaming_P9020234_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/159/medium640/gaming_P9020234_2k.jpg?1504640814)

![gaming_P9020237_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/160/medium640/gaming_P9020237_2k.jpg?1504640916)

![gaming_P9020238_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/161/medium640/gaming_P9020238_2k.jpg?1504640925)

![gaming_P9020239_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/046/162/medium640/gaming_P9020239_2k.jpg?1504640950)

![](https://cdn-learn.adafruit.com/assets/assets/000/046/167/medium800/gaming_P9020266_2k.jpg?1504642632)

You're just about ready to play!

![](https://cdn-learn.adafruit.com/assets/assets/000/046/166/medium800thumb/gaming_pinTurn.jpg?1504642517)

# Mini Pinball Table with Gemma M0

## Play Pinball!

![](https://cdn-learn.adafruit.com/assets/assets/000/046/164/medium800/gaming_P9020258_2k.jpg?1504641072)

Go ahead and re-connect the Gemma M0 to the short USB cable and USB-to-Lightning adapter, make sure the Gemma M0 is turned on, then fire up your pinball game!

Info: 

Here's the live stream video for more details:

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

SAVE CANCEL DELETE


## Featured Products

### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
### Arcade Button - 30mm Translucent Pink

[Arcade Button - 30mm Translucent Pink](https://www.adafruit.com/product/472)
A button is a button, and a switch is a switch, but these translucent arcade buttons are in a class of their own. They're the same size as common arcade controls (often referred to as 30mm diameter) but have some nice things going for them that justify the extra dollar.  
  
First,...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/472)
[Related Guides to the Product](https://learn.adafruit.com/products/472/guides)
### Arcade Button with LED - 30mm Translucent Blue

[Arcade Button with LED - 30mm Translucent Blue](https://www.adafruit.com/product/3490)
A button is a button, and a switch is a switch, but these translucent arcade buttons are in a class of their own. Particularly because they have&nbsp; **LEDs built right in!** &nbsp;That's right, you'll be button-mashing amidst a wash of beautiful light with these lil'...

In Stock
[Buy Now](https://www.adafruit.com/product/3490)
[Related Guides to the Product](https://learn.adafruit.com/products/3490/guides)
### Arcade Button Quick-Connect Wire Pairs - 0.11" (10 pack)

[Arcade Button Quick-Connect Wire Pairs - 0.11" (10 pack)](https://www.adafruit.com/product/1152)
Quick connector wire sets will make wiring up our arcade-style or metal buttons quicky-quick. Each wire comes as a 'pair' with two 0.11" quick-connects pre-crimped onto 20cm long wires. The wires are then terminated together in a JST 2.5mm/0.1" spaced 2-pin connector (we...

In Stock
[Buy Now](https://www.adafruit.com/product/1152)
[Related Guides to the Product](https://learn.adafruit.com/products/1152/guides)
### Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces](https://www.adafruit.com/product/3255)
For bread-boarding with unusual non-header-friendly surfaces, these cables will be your best friends! No longer will you have long strands of alligator clips that are grabbing little wires. These compact jumper cables have a premium male header on one end, and a grippy mini alligator clip on...

In Stock
[Buy Now](https://www.adafruit.com/product/3255)
[Related Guides to the Product](https://learn.adafruit.com/products/3255/guides)
### Short Wire Alligator Clip Test Lead (set of 12)

[Short Wire Alligator Clip Test Lead (set of 12)](https://www.adafruit.com/product/1592)
Connect this to that without soldering using these handy mini alligator clip test leads. Approximately 4.5" overall cables with alligator clip on each end, color coded. You get 12 pieces in 6 colors. Strong and grippy, these always come in handy! We often use these in conjunction with a...

In Stock
[Buy Now](https://www.adafruit.com/product/1592)
[Related Guides to the Product](https://learn.adafruit.com/products/1592/guides)
### USB cable - 6" A/MicroB

[USB cable - 6" A/MicroB](https://www.adafruit.com/product/898)
This here is your standard A-microB USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your NETduino, Arduino Leonardo, Raspberry Pi (among other things).  
  
Approximately 6.5" long from end to end, its a little more compact than our classic 3' long cable  
<br...></br...>

In Stock
[Buy Now](https://www.adafruit.com/product/898)
[Related Guides to the Product](https://learn.adafruit.com/products/898/guides)
### Black Nylon Machine Screw and Stand-off Set – M2.5 Thread

[Black Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3299)
Totaling 380 pieces, this **M2.5 Screw Set** &nbsp;is a must-have for your workstation.&nbsp;You'll have enough screws, nuts, and hex standoffs to fuel your maker tendencies&nbsp;for days on end! M2.5 size screws fit almost all of the Adafruit breakout/dev board mounting holes...

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

## Related Guides

- [New Years Eve Ball Drop](https://learn.adafruit.com/new-years-eve-ball-drop.md)
- [Getting Started with Microsoft Azure and CircuitPython](https://learn.adafruit.com/getting-started-with-microsoft-azure-and-circuitpython.md)
- [PyPortal Air Quality Display](https://learn.adafruit.com/pyportal-air-quality-display.md)
- [DIY Thermal Light Painting - Heat Map Photography](https://learn.adafruit.com/diy-flir-light-painting-heat-map-photography.md)
- [Knobby Sequencer](https://learn.adafruit.com/knobby-sequencer.md)
- [micro:bit Lesson 2. Controlling LEDs on Breadboard](https://learn.adafruit.com/micro-bit-lesson-2-controlling-leds-on-breadboard.md)
- [USB Host to BLE Keyboard Adapter](https://learn.adafruit.com/esp32-s3-usb-to-ble-keyboard-adapter.md)
- [Gemma M0 Vibration Sensor Motion Alarm](https://learn.adafruit.com/motion-alarm.md)
- [Adafruit LED Sequins](https://learn.adafruit.com/adafruit-led-sequins.md)
- [Personal and Portable ESP32-S2 Web Server](https://learn.adafruit.com/wordle-personal-esp32-s2-web-server.md)
- [CircuitPython Hardware: ILI9341 TFT & FeatherWing](https://learn.adafruit.com/micropython-hardware-ili9341-tft-and-featherwing.md)
- [Circuit Playground Express: Piano de Limones](https://learn.adafruit.com/circuit-playground-express-piano-de-limones.md)
- [Numpad 4000 Mechanical Keyswitch Data Entry Device](https://learn.adafruit.com/numpad-4000-mechanical-keyswitch-data-entry-device.md)
- [Using DS18B20 Temperature Sensor with CircuitPython](https://learn.adafruit.com/using-ds18b20-temperature-sensor-with-circuitpython.md)
- [CircuitPython Essentials](https://learn.adafruit.com/circuitpython-essentials.md)
