# NeoPixel Run LED Arcade Game

## Overview

https://youtu.be/TFzHOti1bYc

## Arcade Inspired Game

Building an arcade game with NeoPixels and CircuitPython! This project is inspired by the “cyclone” LED chase games often found in arcades. The enclosure is 3D printed and snap fits together. Inside is an Adafruit Feather, an arcade button, a rechargeable battery and a slide switch.

![led_pixels_blue-chase-loop.gif](https://cdn-learn.adafruit.com/assets/assets/000/093/557/medium640thumb/led_pixels_blue-chase-loop.jpg?1595875609)

## Game Goals & Rules

The goal is to press the button when the LED lands on the target pixels. The game advances and speeds up as you score and hit the targets. The running pixel changes color as you level up and goes in the order of ROYGBIV.

The target pixels are placed randomly so it’s different for each level. If you miss a target, the LEDs flash red and the game starts over with the slow speed.

![led_pixels_wide-loop.gif](https://cdn-learn.adafruit.com/assets/assets/000/093/559/medium640thumb/led_pixels_wide-loop.jpg?1595876262)

![led_pixels_chase-close-loop.gif](https://cdn-learn.adafruit.com/assets/assets/000/093/560/medium640thumb/led_pixels_chase-close-loop.jpg?1595876278)

## Parts
### Adafruit Feather M4 Express - Featuring ATSAMD51

[Adafruit Feather M4 Express - Featuring ATSAMD51](https://www.adafruit.com/product/3857)
It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox, half bird, OK?) This feather is powered by our new favorite chip, the **ATSAMD51J19** -&nbsp; with...

In Stock
[Buy Now](https://www.adafruit.com/product/3857)
[Related Guides to the Product](https://learn.adafruit.com/products/3857/guides)
![Angled shot of a Adafruit Feather M4 Express. ](https://cdn-shop.adafruit.com/640x480/3857-10.jpg)

### Adafruit Mini Skinny NeoPixel Digital RGB LED Strip - 144 LED/m

[Adafruit Mini Skinny NeoPixel Digital RGB LED Strip - 144 LED/m](https://www.adafruit.com/product/2969)
So thin. So mini. So teeeeeeny-tiny. It's the 'skinny' version of our classic NeoPixel strips!

These NeoPixel strips have 144 digitally-addressable pixel Mini LEDs per meter and are very affordable and are only 7.5 mm wide (0.3")&nbsp;if you remove the strip from the...

In Stock
[Buy Now](https://www.adafruit.com/product/2969)
[Related Guides to the Product](https://learn.adafruit.com/products/2969/guides)
![Adafruit NeoPixel Digital RGB LED Strip with all the LEDs in a rainbow](https://cdn-shop.adafruit.com/product-videos/640x480/2969-04.jpg)

### Mini LED Arcade Button - 24mm Green

[Mini LED Arcade Button - 24mm Green](https://www.adafruit.com/product/3433)
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 **LEDs built right in!** 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/3433)
[Related Guides to the Product](https://learn.adafruit.com/products/3433/guides)
![Video of 24mm mini translucent green LED arcade button flashing on and off.](https://cdn-shop.adafruit.com/product-videos/640x480/3433-03.jpg)

### Lithium Ion Polymer Battery with Short Cable - 3.7V 420mAh

[Lithium Ion Polymer Battery with Short Cable - 3.7V 420mAh](https://www.adafruit.com/product/4236)
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 420mAh for a total of about 1.55 Wh. If you need a larger (or smaller!) battery, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4236)
[Related Guides to the Product](https://learn.adafruit.com/products/4236/guides)
![Lithium Ion Polymer Battery 3.7v 420mAh with JST 2-PH connector and short cable](https://cdn-shop.adafruit.com/640x480/4236-04.jpg)

### Part: 10-wire ribbon cable
quantity: 1
silicone cover stranded-core
[10-wire ribbon cable](https://www.adafruit.com/product/3890)

### Part: slide switch
quantity: 1
breadboard friendly
[slide switch](https://www.adafruit.com/product/805)

### Part: JST Extension cable
quantity: 1
2-pin JST cable
[JST Extension cable](https://www.adafruit.com/product/1131)

### Part: Quick-Connects
quantity: 1
Arcade Button Quick-Connect Wire Pairs - 0.11" (10 pack)
[Quick-Connects](https://www.adafruit.com/product/1152)

### Part: USB cable
quantity: 1
USB cable - USB A to Micro-B
[USB cable](https://www.adafruit.com/product/592)

# NeoPixel Run LED Arcade Game

## Circuit Diagram

The diagram below provides a visual reference for wiring of the components. This diagram was created using the software package [Fritzing](http://fritzing.org/download/).

## Adafruit Library for Fritzing

Use Adafruit's Fritzing parts library to create circuit diagrams for your projects. Download the library or just grab individual parts. Get the library and parts from [GitHub - Adafruit Fritzing Parts](https://github.com/adafruit/Fritzing-Library/tree/master/parts).

![](https://cdn-learn.adafruit.com/assets/assets/000/093/564/medium800/led_pixels_led-chase-frit-update.jpg?1595882633)

## Wired Connections

- **5V** from LED Strip to **3V** on Feather
- **GND** from LED Strip to **GND** on Feather
- **DIN** from LED Strip to **Pin #6** &nbsp;on Feather
- Button to **Pin #5** &nbsp;on Feather
- Button to **GND** on Feather
- Switch to **GND** on Feather
- Switch to **EN** on Feather

## Powering

The Adafruit board can be powered via USB or JST using a 3.7v lipo battery. In this project, a 420mAh lipo battery is used. The lipo battery is rechargeable via the USB port on the board. The switch is wired to the **enable** &nbsp;and&nbsp; **ground** pins on the board.

# NeoPixel Run LED Arcade Game

## 3D Printing

## Parts List

STL files for 3D printing are oriented to print "as-is" on FDM style machines. Parts are designed to 3D print without any support material. Original design source may be downloaded using the links below.

- shell-led-chase.stl
- lid-led-chase.stl
- diffuser-led-chase.stl
- button-sleve.stl

![led_pixels_3d-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/561/medium640/led_pixels_3d-parts.jpg?1595880240)

[Edit Design](https://a360.co/3hHmulH)
[Download CAD files from PrusaPrinters](https://www.prusaprinters.org/prints/37528-neopixel-run-led-chase-arcade-game)
[Download CAD files from Thingiverse](https://www.thingiverse.com/thing:4555808)
## Slicing Parts

No supports are required. Slice with settings for PLA material.

The parts were sliced using CURA using the slice settings below.

- PLA filament 220c extruder
- 0.2 layer height
- 10% gyroid infill
- 90mm/s print speed
- 60c heated bed

![led_pixels_slice-loop-sq.gif](https://cdn-learn.adafruit.com/assets/assets/000/093/563/medium640thumb/led_pixels_slice-loop-sq.jpg?1595881933)

## Design Source Files

The project assembly was designed in Fusion 360. This can be downloaded in different formats like STEP, STL and more. Electronic components like Adafruit's board, displays, connectors and more can be downloaded from the [Adafruit CAD parts GitHub Repo](https://github.com/adafruit/Adafruit_CAD_Parts).

![led_pixels_cad-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/570/medium640/led_pixels_cad-parts.jpg?1595889262)

# NeoPixel Run LED Arcade Game

## CircuitPython on Feather M4 Express

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the **CIRCUITPY** drive to iterate.

The following instructions will show you how to install CircuitPython. If you've already installed CircuitPython but are looking to update it or reinstall it, the same steps work for that as well!

## Set up CircuitPython Quick Start!

Follow this quick step-by-step for super-fast Python power :)

[Download the latest version of CircuitPython for this board via CircuitPython.org](https://circuitpython.org/board/feather_m4_express/)
 **Click the link above and download the latest UF2 file.**

Download and save it to your desktop (or wherever is handy).

![arduino_compatibles_FeatherM0ExpressUF2Downloaded.png](https://cdn-learn.adafruit.com/assets/assets/000/057/318/medium640/arduino_compatibles_FeatherM0ExpressUF2Downloaded.png?1531152402)

Plug your Feather M4 into your computer using a known-good USB cable.

**A lot of people end up using charge-only USB cables and it is very frustrating! So make sure you have a USB cable you know is good for data sync.**

Double-click the **Reset** button next to the USB connector on your board, and you will see the NeoPixel RGB LED turn green. If it turns red, check the USB cable, try another USB port, etc. **Note:** The little red LED next to the USB connector will pulse red. That's ok!

If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!

![arduino_compatibles_FeatherM0Bootloader.jpg](https://cdn-learn.adafruit.com/assets/assets/000/057/320/medium640/arduino_compatibles_FeatherM0Bootloader.jpg?1531152568)

You will see a new disk drive appear called **FEATHERBOOT**.

&nbsp;

&nbsp;

&nbsp;

Drag the **adafruit\_circuitpython\_etc.uf2** file to **FEATHERBOOT.**

![arduino_compatibles_FeatherM0FEATHERBOOT.png](https://cdn-learn.adafruit.com/assets/assets/000/057/321/medium640/arduino_compatibles_FeatherM0FEATHERBOOT.png?1531152779)

![arduino_compatibles_FeatherM0DragCircuitPythonUF2.png](https://cdn-learn.adafruit.com/assets/assets/000/057/324/medium640/arduino_compatibles_FeatherM0DragCircuitPythonUF2.png?1531152877)

The LED will flash. Then, the **FEATHERBOOT** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

That's it, you're done! :)

![arduino_compatibles_FeatherM0CIRCUITPY.png](https://cdn-learn.adafruit.com/assets/assets/000/057/323/medium640/arduino_compatibles_FeatherM0CIRCUITPY.png?1531152841)

## Further Information

For more detailed info on installing CircuitPython, check out [Installing CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython).

# NeoPixel Run LED Arcade Game

## Coding the Pixel Chase Game

## Installing Project Code

To use with CircuitPython, you need to first install a few libraries, into the lib folder on your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, open the directory **Pixel\_Chase\_Game/** and then click on the directory that matches the version of CircuitPython you're using and copy the contents of that directory to your **CIRCUITPY** drive.

Your **CIRCUITPY** drive should now look similar to the following image:

![CIRCUITPY](https://adafruit.github.io/Adafruit_Learning_System_Guides/Pixel_Chase_Game.png )

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

# NeoPixel Run LED Arcade Game

## Pixel Chase Game CircuitPython Code Walkthrough

## Import the Libraries

First, the CircuitPython libraries are imported. The **adafruit\_led\_animation** library is being used as a way to easily access different colors for the NeoPixels.

![led_pixels_CP-medium.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/567/medium640/led_pixels_CP-medium.jpg?1595886032)

```python
import time
import random
import board
import neopixel
import digitalio
import adafruit_led_animation.color as color
```

## Setup the Button and NeoPixels
Next, the button's pin is setup.

```python
#  button pin setup
button = digitalio.DigitalInOut(board.D5)
button.direction = digitalio.Direction.INPUT
button.pull = digitalio.Pull.UP
```

Followed by the NeoPixel setup.

```python
#  neopixel setup
pixel_pin = board.D6
num_pixels = 61

pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.2, auto_write=False)
```

## NeoPixel Animations
Three functions are brought in to continue the NeoPixel setup. All three of them are classic NeoPixel animations: `rainbow_cycle` and `color_chase`.

```python
#  wheel and rainbow_cycle setup
def wheel(pos):
    if pos < 0 or pos > 255:
        return (0, 0, 0)
    if pos < 85:
        return (255 - pos * 3, pos * 3, 0)
    if pos < 170:
        pos -= 85
        return (0, 255 - pos * 3, pos * 3)
    pos -= 170
    return (pos * 3, 0, 255 - pos * 3)

def rainbow_cycle(wait):
    for j in range(255):
        for i in range(num_pixels):
            rc_index = (i * 256 // 10) + j
            pixels[i] = wheel(rc_index & 255)
        pixels.show()
        time.sleep(wait)

#  color_chase setup
def color_chase(c, wait):
    for i in range(num_pixels):
        pixels[i] = c
        time.sleep(wait)
        pixels.show()
    time.sleep(0.5)
```

[For more info on NeoPixels and CircuitPython, check out this Learn Guide page.](https://learn.adafruit.com/adafruit-metro-m0-express-designed-for-circuitpython/circuitpython-neopixel)
These animation functions are followed by the `game_over()` function. This function allows for the NeoPixel strip to use `color_chase` to turn off the NeoPixels and then blink the strip red when you lose a level in the game. The reason for setting it up as a function rather than in the `loop` is to keep the loop easier to read since there will be other things going on.

```python
#  function to blink the neopixels when you lose
def game_over():
    color_chase(color.BLACK, 0.05)
    pixels.fill(color.RED)
    pixels.show()
    time.sleep(0.5)
    pixels.fill(color.BLACK)
    pixels.show()
    time.sleep(0.5)
    pixels.fill(color.RED)
    pixels.show()
    time.sleep(0.5)
    pixels.fill(color.BLACK)
    pixels.show()
    time.sleep(0.5)
    pixels.fill(color.RED)
    pixels.show()
    time.sleep(1)
```

## Variables and States
Next are the variables and state machines that will be used in the loop. Their functions are commented next to them.

```python
#  variables and states
pixel = 0 #  time.monotonic() holder
num = 0 #  chaser NeoPixel position
last_num = 0 #  previous chaser position
now_color = 0 #  chaser NeoPixel color
next_color = 1 #  target NeoPixel color
speed = 0.1 #  default speed for chaser
level = 0.005 #  speed increase increment
final_level = 0.001 #  final level speed
new_target = True #  state to denote a new level
button_state = False #  button debouncing state
```

## Colors
The last piece of setup before the loop is the NeoPixel colors. Using the **adafruit\_led\_animation** library, you can insert colors easily to assign to the NeoPixels without having to determine RGB values.&nbsp;

This array of colors will be used to cycle through colors as you advance through the game, using `now_color` and `next_color` to index your position in the array. `now_color` will be the color of the chaser pixel and `next_color` will be the color of the target pixel.&nbsp;

```python
#  neopixel colors
colors = [color.RED, color.ORANGE, color.YELLOW, color.GREEN, color.TEAL, color.CYAN,
          color.BLUE, color.PURPLE, color.MAGENTA, color.GOLD, color.AQUA, color.PINK]
```

## The Loop
The loop begins with an `if` statement for button debouncing.

```python
#  button debouncing
    if not button.value and not button_state:
        button_state = True
```

## Randomized Target
`x`, `y` and `z` hold the target pixel positions. `y` is setup to hold a random integer within the range of `5` and `55`. This position is reset every time you advance a level. `x` and `z` are setup to be on either side of `y`.

`x` and `z` are setup to be white to highlight the target pixel, which is setup to be the `next_color` index in the `colors` array.

```python
#  if new level starting..
    if new_target:
        #  randomize target location
        y = int(random.randint(5, 55))
        x = int(y - 1)
        z = int(y + 1)
        new_target = False
        print(x, y, z)
    pixels[x] = color.WHITE
    pixels[y] = colors[next_color]
    pixels[z] = color.WHITE
```

## Playing the Game
Game play begins using `time.monotonic()` instead of `time.sleep()` to delay the loop. `time.sleep()` delays the entire loop, where as when you use `time.monotonic()`, the timing is tracked without stopping the entire loop.

```python
#  delay without time.sleep()
if (pixel + speed) < time.monotonic():
```

## Chaser Pixel Animation
Before getting into hitting pressing the button to hit the target NeoPixel, there are a few things that need to happen in the code in order for the chaser pixel to move.

First, when the chaser pixel (tracked with `num`) moves forward, the previous pixel is turned off. This previous pixel is tracked with `last_num`.

```python
#  turn off pixel behind chaser
if num > 0:
    last_num = num - 1
    pixels[last_num] = color.BLACK
    pixels.show()
```

You also want to keep the target pixels their preset colors, even as the chaser pixel passes them.

```python
#  keep target pixels their colors when the chaser passes
if last_num in (x, y, z):
    pixels[x] = color.WHITE
    pixels[y] = colors[next_color]
    pixels[z] = color.WHITE
```

How does the chaser pixel move though? While the position of the chaser pixel is less than the total number of NeoPixels, it advances by one pixel position.

```python
#  move chaser pixel by one
if num < num_pixels:
    pixels[num] = colors[now_color]
    pixels.show()
    #print(num)
    #print("target is", y)
    num += 1
```

When the chaser reaches the end of the NeoPixel strip, `num` is reset to `0` to send the chaser back to the beginning of the strip.

```python
#  send chaser back to the beginning of the circle
if num == num_pixels:
    last_num = num - 1
    pixels[last_num] = color.BLACK
    pixels.show()
    num = 0
```

## Level-Up
Using the button, you'll try and line-up the chaser pixel with the target pixel to score. When you score, all of the NeoPixels will light-up with the `next_color`, which the target pixel had been showing.

The position of the chaser pixel is reset to `0` and the `speed` is increased by the increment stored in `level`. The `now_color` and `next_color` indexes are also increased by `1`. Finally, `new_target` is set to `True` in order to setup a new target pixel.

```python
#  if the chaser hits the target...
        if last_num in [x, y, z] and not button.value:
            button_state = False
            #  fills with the next color
            pixels.fill(colors[next_color])
            pixels.show()
            print(num)
            print(x, y, z)
            #  chaser resets
            num = 0
            time.sleep(0.5)
            pixels.fill(color.BLACK)
            pixels.show()
            #  speed increases for next level
            speed = speed - level
            #  color updates
            next_color = next_color + 1
            if next_color > 11:
                next_color = 0
            now_color = now_color + 1
            if now_color > 11:
                now_color = 0
            #  setup for new target
            new_target = True
            print("speed is", speed)
            print("button is", button.value)
```

## Missing the Target
If you miss the target pixel with your button press, all of the NeoPixels will light-up with the `now_color`. This is the same color that the chaser pixel had been.

Then, the `game_over()` function animates the NeoPixels by using `color_chase` to turn all of the pixels off and then flash them all red.

To set things up for a new game, the position of the chaser pixel is reset to&nbsp;`0`&nbsp;and the&nbsp;`speed`&nbsp;is reset to its default value. The&nbsp;`now_color`&nbsp;and&nbsp;`next_color`&nbsp;indexes are also reset. Finally,&nbsp;`new_target`&nbsp;is set to&nbsp;`True`&nbsp;in order to setup a new target pixel.

```python
#  if the chaser misses the target...
        if last_num not in [x, y, z] and not button.value:
            button_state = False
            print(num)
            print(x, y, z)
            #  fills with current chaser color
            pixels.fill(colors[now_color])
            pixels.show()
            #  function to flash all pixels red
            game_over()
            #  chaser is reset
            num = 0
            pixels.fill(color.BLACK)
            pixels.show()
            #  speed is reset to default
            speed = 0.1
            #  colors are reset
            next_color = 1
            now_color = 0
            #  setup for new target
            new_target = True
            print("speed is", speed)
            print("button is", button.value)
```

## You Win!
If you happen to be an expert at the NeoPixel Run Game, you'll defeat all of the targets with your chaser pixel and eventually run out of levels. You'll know you've won when all of the NeoPixels animate using the classic `rainbow_cycle()` animation.

After some fun rainbows, all of the game parameters are reset to their defaults so that you can begin playing again.

```python
#  when you have beaten all the levels...
        if speed < final_level:
            #  rainbows!
            rainbow_cycle(0.01)
            time.sleep(1)
            #  chaser is reset
            num = 0
            pixels.fill(color.BLACK)
            pixels.show()
            #  speed is reset to default
            speed = 0.1
            #  colors are reset
            next_color = 1
            now_color = 0
            #  setup for new target
            new_target = True
```

## Time Tracking
The last line of the loop updates `pixel` to grab the current `time.monotonic()` time.

```python
#  time.monotonic() is reset for the delay
pixel = time.monotonic()
```

# NeoPixel Run LED Arcade Game

## Assemble

## Solder LED Strip

Cut a high density Neopixel strip to 61 pixels and use silicone ribbon cable to help keep the wires bundled.

Tin the pads on the NeoPixel strip and solder wires to the data and power and ground pads.

![led_pixels_strip-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/531/medium640/led_pixels_strip-solder.jpg?1595859749)

## Slide switch&nbsp;

Tin two pins on the slide switch. Add heat shrink to each wire and then solder to each pin on the slide switch.&nbsp;

Use the side of the solder iron to heat and shrink the connections.

![led_pixels_slide-switch.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/532/medium640/led_pixels_slide-switch.jpg?1595859807)

## Solder quick connects

Use one of the ground connections close to the prototyping area to solder the quick connect wires for the button. The other wire connects to pin 5.

![led_pixels_quick-connect-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/533/medium640/led_pixels_quick-connect-solder.jpg?1595860035)

## Test Circuit

Connecting the button and battery to the Feather to quickly test the connections.&nbsp;

&nbsp;

![led_pixels_circuit-test.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/535/medium640/led_pixels_circuit-test.jpg?1595861151)

## Mount Feather

Orient the Feather board so the USB connection is facing the cut out on the case.

Use four M2.5 x 5mm long screws to secure the Feather board to the standoffs on the case.

![led_pixels_feeather-place.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/536/medium640/led_pixels_feeather-place.jpg?1595861232)

## Mount LED strip

Pass the LED strip wires through the cutoff on the inside of the case. Wrap the LED strip along the inner wall of the case.

Use kapton tape to cover the pads on the end of the NeoPixel strip so the pads doesn't short the circuit.&nbsp;

![led_pixels_strip-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/547/medium640/led_pixels_strip-mount.jpg?1595865835)

![led_pixels_strip-kapton-ends.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/548/medium640/led_pixels_strip-kapton-ends.jpg?1595866018)

## Mount slide switch

Place the switch to the middle position and then angle the whole slide switch so it can press fit between the three walls on the case.

&nbsp;

![led_pixels_slide-switch-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/549/medium640/led_pixels_slide-switch-mount.jpg?1595866102)

## Mount diffuser

Arrange the printed diffuser with the bigger lip face up. Gently bend the diffuser so it can press fit over the LED strip.&nbsp;

## Plug in Battery

Plug in the JST extension cable to the Feather board and then attach the battery. Use foam tape to secure the battery to the case.&nbsp;

![led_pixels_diffuser-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/551/medium640/led_pixels_diffuser-mount.jpg?1595866225)

![led_pixels_battery-plugin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/552/medium640/led_pixels_battery-plugin.jpg?1595866268)

## Attach Shelf

Use pliers to slightly bend the connections to fit inside the case.

## Mount Button

Attach the printed button shelf to the button.

Align the button with the crown icon as shown. Pass the button at an angle and then twist clockwise to mount the button.&nbsp;

![led_pixels_button-insert.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/553/medium640/led_pixels_button-insert.jpg?1595866600)

![led_pixels_button-turn.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/554/medium640/led_pixels_button-turn.jpg?1595866395)

## Connect button

Attach the quick connect wires to the button. The wires attach to the connections close the points on the crown icon.

## Align Lid

Match the cut out on the lid to the slide switch. Use slight force to press fit each nub around the lid on to the case.

![led_pixels_button-connected.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/555/medium640/led_pixels_button-connected.jpg?1595866457)

![led_pixels_lid-align.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/556/medium640/led_pixels_lid-align.jpg?1595866859)

![](https://cdn-learn.adafruit.com/assets/assets/000/093/571/medium800thumb/led_pixels_spin-loop.jpg?1595891154)


## Featured Products

### Adafruit Feather M4 Express - Featuring ATSAMD51

[Adafruit Feather M4 Express - Featuring ATSAMD51](https://www.adafruit.com/product/3857)
It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox, half bird, OK?) This feather is powered by our new favorite chip, the **ATSAMD51J19** -&nbsp; with...

In Stock
[Buy Now](https://www.adafruit.com/product/3857)
[Related Guides to the Product](https://learn.adafruit.com/products/3857/guides)
### Adafruit Mini Skinny NeoPixel Digital RGB LED Strip - 144 LED/m

[Adafruit Mini Skinny NeoPixel Digital RGB LED Strip - 144 LED/m](https://www.adafruit.com/product/2969)
So thin. So mini. So teeeeeeny-tiny. It's the 'skinny' version of our classic NeoPixel strips!

These NeoPixel strips have 144 digitally-addressable pixel Mini LEDs per meter and are very affordable and are only 7.5 mm wide (0.3")&nbsp;if you remove the strip from the...

In Stock
[Buy Now](https://www.adafruit.com/product/2969)
[Related Guides to the Product](https://learn.adafruit.com/products/2969/guides)
### Mini LED Arcade Button - 24mm Translucent Clear

[Mini LED Arcade Button - 24mm Translucent Clear](https://www.adafruit.com/product/3429)
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 **LEDs built right in!** 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/3429)
[Related Guides to the Product](https://learn.adafruit.com/products/3429/guides)
### Arcade Button with LED - 30mm Translucent Red

[Arcade Button with LED - 30mm Translucent Red](https://www.adafruit.com/product/3489)
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/3489)
[Related Guides to the Product](https://learn.adafruit.com/products/3489/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...

Out of Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
### Lithium Ion Polymer Battery with Short Cable - 3.7V 420mAh

[Lithium Ion Polymer Battery with Short Cable - 3.7V 420mAh](https://www.adafruit.com/product/4236)
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 420mAh for a total of about 1.55 Wh. If you need a larger (or smaller!) battery, <a...></a...>

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

Out of Stock
[Buy Now](https://www.adafruit.com/product/1152)
[Related Guides to the Product](https://learn.adafruit.com/products/1152/guides)
### JST-PH Battery Extension Cable - 500mm

[JST-PH Battery Extension Cable - 500mm](https://www.adafruit.com/product/1131)
By popular demand, we now have a handy extension cord for all of our JST PH-terminated battery packs (such as our LiIon/LiPoly and 3xAAA holders). One end has a JST-PH compatible socket, and the other end has a matching plug. Between the two, 500mm of color coded wire. Handy for wearable...

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

## Related Guides

- [Adafruit Feather M4 Express](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51.md)
- [RGB LED Matrices with CircuitPython](https://learn.adafruit.com/rgb-led-matrices-matrix-panels-with-circuitpython.md)
- [Multi-tasking with CircuitPython](https://learn.adafruit.com/multi-tasking-with-circuitpython.md)
- [Lego Neon NeoPixel Sign with CircuitPython](https://learn.adafruit.com/lego-neon-sign.md)
- [Adafruit MSA301 Triple Axis Accelerometer](https://learn.adafruit.com/msa301-triple-axis-accelerometer.md)
- [CircuitPython 101: State Machines, Two Ways](https://learn.adafruit.com/circuitpython-101-state-machines.md)
- [RGB Matrix Slot Machine](https://learn.adafruit.com/rgb-matrix-slot-machine.md)
- [eInk FeatherWing Display Stand](https://learn.adafruit.com/eink-featherwing-display-stand.md)
- [Computer Space Mini Arcade](https://learn.adafruit.com/computer-space-mini-arcade.md)
- [Control Electronics with your Brain using NextMind](https://learn.adafruit.com/control-electronics-with-your-brain-using-nextmind.md)
- [Esenciales para CircuitPython](https://learn.adafruit.com/esenciales-para-circuitpython.md)
- [Quickstart using Adafruit eInk/ePaper displays with CircuitPython](https://learn.adafruit.com/quickstart-using-adafruit-eink-epaper-displays-with-circuitpython.md)
- [Use circup to easily keep your CircuitPython libraries up to date](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup.md)
- [Ocean Epoxy Resin Lightbox with RGB LED Matrix Image Scroller](https://learn.adafruit.com/ocean-epoxy-resin-lightbox-with-rgb-led-matrix-image-scroller.md)
- [CircuitPython Motorized Camera Slider](https://learn.adafruit.com/circuitpython-motorized-camera-slider.md)
- [Adafruit VCNL4040 Proximity Sensor](https://learn.adafruit.com/adafruit-vcnl4040-proximity-sensor.md)
