# Labo Piano Light FX

## Overview

[Nintendo Labo Toy-Cons](https://labo.nintendo.com/kits/variety-kit/) are a lot of fun to build, but customizing them is the real icing on the cake.&nbsp; Let's spice up the **Piano Toy-Con** with sound-triggered lighting effects courtesy of&nbsp;[Circuit Playground Express.](https://www.adafruit.com/product/3333)

![](https://cdn-learn.adafruit.com/assets/assets/000/053/325/medium800/circuitpython_labo-thumbnail2.jpg?1524769973)

# What you'll need

- Nintendo Switch
- Assembled Labo Piano Toy-Con
- [Circuit Playground Express](https://www.adafruit.com/product/3333)
- [Electret Microphone Amplifier Board](https://www.adafruit.com/product/1713)
- Silicone Cover Stranded Wire in [three](https://www.adafruit.com/product/2006) [different](https://www.adafruit.com/product/2002) [colors](https://www.adafruit.com/product/2001) ([solid core](https://www.adafruit.com/product/3111) works too!)
- [LiPo Battery](https://www.adafruit.com/product/1578)
- [Soldering Iron](https://www.adafruit.com/product/3685) & [Solder](https://www.adafruit.com/product/1886)
- Double Sided Tape
- [Wire Strippers](https://www.adafruit.com/product/527)
- [Micro USB cable](https://www.adafruit.com/product/592)
- Computer

# Labo Piano Light FX

## Wiring

Circuit Playground Express has a built-in microphone, but we'll need to mount it away from the Switch's speakers in order to see our lighting effects.&nbsp; Let's use a separate mic that we can mount close to the Switch's speaker - then use wires to connect it to the Circuit Playground Express.

# Prep the wires
- Cut **three pieces of wire** - each about **30cm** long, one in **blue** , one in **white** , and one in **red**.
- **Strip about 7mm** of shielding from both ends of each wire.
- **Tin** each exposed end with **solder**.

![circuitpython_labo-0.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/305/medium640/circuitpython_labo-0.jpg?1524693401)

![circuitpython_labo-1-4x3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/306/medium640/circuitpython_labo-1-4x3.jpg?1524693410)

![circuitpython_labo-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/307/medium640/circuitpython_labo-2.jpg?1524693415)

![circuitpython_labo-3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/308/medium640/circuitpython_labo-3.jpg?1524693420)

# Solder wires to the Circuit Playground Express

Now we'll connect those wires to the Circuit Playground's contacts. Each wire color connects to a specific contact pad:

- **Red** wire connects to **3.3V**
- **Blue** wire connects to **GND**
- **White** wire connects to **A7** &nbsp;

Poke each tinned wire lead through its corresponding contact pad, bend the wire around the outside of the pad to keep it in place - and then **solder it** securely.

# Solder Wires to the Electret Microphone Amplifier

Next, we'll **connect our wiring** to the **Microphone board.&nbsp;** Each wire color connects to **a specific pad** on the **Microphone board**. Poke each wire through its respective pad and solder in place:

- **Red** wire connects to **V+**
- **Blue** wire connects to **GND**
- **White** wire connects to **Out**

Once each wire is soldered to the board, clip any excess leads off to avoid accidental bridginf between the pads.

That's all for soldering and wiring - now we can move on to programming the board.

# Labo Piano Light FX

## Software

Now we'll add the software that will make Circuit Playground Express's neopixels light up whenever the Electret Microphone board detects sound.

## Connect
![](https://cdn-learn.adafruit.com/assets/assets/000/053/332/medium800/circuitpython_labo-7.jpg?1524773834)

Connect the **Circuit Playground Express to your computer** with a **micro USB cable**.&nbsp; You should see a drive named **"CIRCUITPY"** appear on your computer.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/053/337/medium800/circuitpython_labo-8b.jpg?1524777283)

## Install Libraries
You'll need to have the **Neopixel library** installed on your Circuit Playground Express in order to run this project's **CircuitPython** code. Follow the steps on [this page to install the CircuitPython library bundle](../../../../welcome-to-circuitpython/circuitpython-libraries#installing-the-circuitpython-library-bundle).

[Installing the CircuitPython Library Bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries#installing-the-circuitpython-library-bundle)
## Upload Project Code
Copy the following code, paste it into a **plain text file** or [code editor such as Mu](../../../../welcome-to-circuitpython/installing-mu-editor). Save the file as **"code.py"** to the **CIRCUITPY drive**.

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

After the file saves, your Circuit Playground Express should reboot and start running the light effects code.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/292/medium800/circuitpython_Screen_Shot_2019-12-04_at_3.38.21_AM.png?1575448820 Once all the code is in place, your CIRCUITPY drive should look like this.)

# Test It
To make sure everything is working, disconnect the Circuit Playground Express from your computer and connect the LiPo battery.

![](https://cdn-learn.adafruit.com/assets/assets/000/053/333/medium800/circuitpython_labo-9.jpg?1524773903)

Now, try tapping the microphone - If the Circuit Playground's neopixels light up with each tap, then you'll know it's good to go!

# Labo Piano Light FX

## Install & Use It!

Now, we just need to install the **Circuit Playground Express** & **Electret Microphone** board in the **Piano Toy-Con**.

# Install the mic
![](https://cdn-learn.adafruit.com/assets/assets/000/053/314/medium800/circuitpython_labo-10.jpg?1524693734)

Push back the **large cardboard plate** that supports the **Switch** until the interlocking front lip pops up.

- Pull the large backing plate forward a bit and **slide the microphone board behind it** - be sure to keep the silver **microphone cylinder facing forward**.
- Pull the large backing plate forward a bit and **slide the microphone board behind it** - be sure to keep the silver **microphone cylinder facing forward**.
- **Tuck the wires** behind the backing plate and route them up the right side - there's a triangular opening that will allow them to reach the Circuit Playground Express on top of the piano.

![circuitpython_labo-11a.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/310/medium640/circuitpython_labo-11a.jpg?1524693685)

![circuitpython_labo-11b.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/311/medium640/circuitpython_labo-11b.jpg?1524693694)

![circuitpython_labo-12a.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/312/medium640/circuitpython_labo-12a.jpg?1524693703)

![circuitpython_labo-12b.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/313/medium640/circuitpython_labo-12b.jpg?1524693713)

Once the wires are routed, **push the front lip back in place** with its tab locked into the backing plate.

# Mount the Circuit Playground Express

Use a small piece of **double-sided tape** to stick the the **LiPo battery** to the back of the **Circuit Playground Express**.

Use another piece of tape to secure the **LiPo battery** and **Circuit Playground Express** to the top of the piano.

# Play - with lights!

Install the **right Joy-Con** in the holder at the back of the piano and place the **Switch console** in its spot at the center. Set the Switch's **volume all the way up** and start up the **Piano Play** mode in the **Labo Variety pack cartridge.** Now - you're good to go!

![](https://cdn-learn.adafruit.com/assets/assets/000/053/338/medium800thumb/circuitpython_labo_piano-ani1.jpg?1524778970)

Now, when you play the piano - you'll have a light show with every performance :)

Info: 


## Featured Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### Electret Microphone Amplifier - MAX9814 with Auto Gain Control

[Electret Microphone Amplifier - MAX9814 with Auto Gain Control](https://www.adafruit.com/product/1713)
Add an ear to your project with this well-designed electret microphone amplifier with AGC. This fully assembled and tested board comes with a 20-20KHz electret microphone soldered on. For the amplification, we use the Maxim MAX9814, a specialty chip that is designed for amplifying electret...

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

[Lithium Ion Polymer Battery - 3.7v 500mAh](https://www.adafruit.com/product/1578)
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 500mAh for a total of about 1.9 Wh. If you need a larger (or smaller!) battery, <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/1578)
[Related Guides to the Product](https://learn.adafruit.com/products/1578/guides)
### Adjustable 60W Pen-Style Soldering Iron - 120VAC USA Plug

[Adjustable 60W Pen-Style Soldering Iron - 120VAC USA Plug](https://www.adafruit.com/product/3685)
You re-work hard all day, so treat yourself with the BEST portable **Adjustable Soldering Iron** we carry!&nbsp; OK, "Best" may be subjective, but it's also the name of the brand, so there ya go! But, seriously folks, this is a really nice iron, good enough for...

In Stock
[Buy Now](https://www.adafruit.com/product/3685)
[Related Guides to the Product](https://learn.adafruit.com/products/3685/guides)
### Solder Wire - 60/40 Rosin Core - 0.5mm/0.02" diameter - 50 grams

[Solder Wire - 60/40 Rosin Core - 0.5mm/0.02" diameter - 50 grams](https://www.adafruit.com/product/1886)
If you want to make a kit you'll need some solder. This 0.1 lb (about 50 grams) spool is a good amount, not too much (like 1 lb spools) and not too little (like those little 'pocket clip' vials).  
  
This spool of solder contains approximately 0.6mm / .02" diameter in...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1886)
[Related Guides to the Product](https://learn.adafruit.com/products/1886/guides)
### Hakko Professional Quality 20-30 AWG Wire Strippers

[Hakko Professional Quality 20-30 AWG Wire Strippers](https://www.adafruit.com/product/527)
These are the finest wire strippers we have used, and if you have to do a lot of wiring, you will agree! They have soft rounded grips - very comfortable to use, and precision ground notches that do a perfect job every time. No more yanking or twisting to strip wires cleanly and quickly.<br...></br...>

In Stock
[Buy Now](https://www.adafruit.com/product/527)
[Related Guides to the Product](https://learn.adafruit.com/products/527/guides)
### Silicone Cover Stranded-Core Wire - 2m 30AWG White

[Silicone Cover Stranded-Core Wire - 2m 30AWG White](https://www.adafruit.com/product/2006)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

In Stock
[Buy Now](https://www.adafruit.com/product/2006)
[Related Guides to the Product](https://learn.adafruit.com/products/2006/guides)
### Silicone Cover Stranded-Core Wire - 2m 30AWG Red

[Silicone Cover Stranded-Core Wire - 2m 30AWG Red](https://www.adafruit.com/product/2001)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

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

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [LEGO Head Lamp with Audio](https://learn.adafruit.com/lego-head-lamp-with-audio.md)
- [CircuitPython Hardware: SD Cards](https://learn.adafruit.com/micropython-hardware-sd-cards.md)
- [LED Masquerade Masks](https://learn.adafruit.com/led-masquerade-masks.md)
- [Glowing Bottle Castle and Capacitive Touch Piano](https://learn.adafruit.com/glowing-bottle-castle-and-capacitive-touch-piano.md)
- [Slider Crank Mechanism -- from Cardboard and Craft Sticks](https://learn.adafruit.com/cardboard-slider-crank.md)
- [Crawling Baby Sea Turtle Robot](https://learn.adafruit.com/baby-turtle-makecode.md)
- [Adafruit Circuit Playground Tri-Color E-Ink Gizmo](https://learn.adafruit.com/adafruit-circuit-playground-tri-color-e-ink-gizmo.md)
- [Schluff - The Sleep Monitor](https://learn.adafruit.com/schluff-the-oshw-sleep-monitor.md)
- [No-Touch Hand Wash Timer for Circuit Playground Express and CLUE](https://learn.adafruit.com/no-touch-hand-wash-timer-for-cpx-and-clue.md)
- [Perfect Pitch Machine](https://learn.adafruit.com/perfect-pitch-machine.md)
- [Using MCP23008 & MCP23017 with CircuitPython](https://learn.adafruit.com/using-mcp23008-mcp23017-with-circuitpython.md)
- [Epoxy Resin Torch Lamp with Touch Control & 3D Printed Base](https://learn.adafruit.com/epoxy-resin-torch-lamp-with-touch-control-3d-printed-base.md)
- [Installing CircuitPython on SAMD21 Boards](https://learn.adafruit.com/installing-circuitpython-on-samd21-boards.md)
- [Simple and Beautiful NeoPixel Holiday Lights](https://learn.adafruit.com/simple-beautiful-color-changing-light-strand.md)
- [Cam Follower Automaton](https://learn.adafruit.com/cam-follower-automaton.md)
