# Color Remote with Circuit Playground Bluefruit

## Overview

https://youtu.be/dZ388vKMHB8

![](https://cdn-learn.adafruit.com/assets/assets/000/082/547/medium800/leds_IMG_6848.jpg?1571427982)

You can build a wireless remote control RGB LED NeoPixel color mixer using two Circuit Playground Bluefruit boards and some slide potentiometers. Using Bluetooth LE, the boards can communicate wirelessly with no need for a computer or mobile phone or tablet!

Thanks to the Adafruit Bluefruit Connect and BLE libraries in CircuitPython, setup and coding are incredibly simple. You can get started quickly and then extend this code to all sorts of other remote projects!

## Parts

First of all, you'll need two Circuit Playground Bluefruit boards:

Featured
### Circuit Playground Bluefruit - Bluetooth® Low Energy

[Circuit Playground Bluefruit - Bluetooth® Low Energy](https://www.adafruit.com/product/4333)
 **Circuit Playground Bluefruit** is our third board in the Circuit Playground series, another step towards a perfect introduction to electronics and programming. We've taken the popular Circuit Playground Express and made it even better! Now the main chip is an nRF52840...

In Stock
[Buy Now](https://www.adafruit.com/product/4333)
[Related Guides to the Product](https://learn.adafruit.com/products/4333/guides)
![shot of a Black woman's neon-green manicured hand holding up a Circuit Playground Bluefruit glowing rainbow LEDs.](https://cdn-shop.adafruit.com/640x480/4333-11.jpg)

### Circuit Playground Bluefruit - Bluetooth® Low Energy

quantity: 2
[Circuit Playground Bluefruit - Bluetooth® Low Energy](https://www.adafruit.com/product/4333)
 **Circuit Playground Bluefruit** is our third board in the Circuit Playground series, another step towards a perfect introduction to electronics and programming. We've taken the popular Circuit Playground Express and made it even better! Now the main chip is an nRF52840...

In Stock
[Buy Now](https://www.adafruit.com/product/4333)
[Related Guides to the Product](https://learn.adafruit.com/products/4333/guides)
![shot of a Black woman's neon-green manicured hand holding up a Circuit Playground Bluefruit glowing rainbow LEDs.](https://cdn-shop.adafruit.com/640x480/4333-11.jpg)

To control the color settings, you'll need three slide potentiometers. These short ones work on a breadboard quite well, any longer and you'll need to come up with more involved solutions for mounting.

Featured
### Slide Potentiometer with Plastic Knob - 35mm Long - 10KΩ

[Slide Potentiometer with Plastic Knob - 35mm Long - 10KΩ](https://www.adafruit.com/product/4271)
_Slip slidin' away&nbsp;  
Slip slidin' away&nbsp;  
You know the nearer your resistance&nbsp;  
The more you're slip slidin' away_

If you're tired of the regular-old-twisty potentiometers we carry, why not _slide_ over and try this slide pot?...

In Stock
[Buy Now](https://www.adafruit.com/product/4271)
[Related Guides to the Product](https://learn.adafruit.com/products/4271/guides)
![hand slowly sliding potentiometer back and forth - 35mm Long.](https://cdn-shop.adafruit.com/product-videos/640x480/4271-04.jpg)

### Slide Potentiometer with Plastic Knob - 35mm Long - 10KΩ

quantity: 3
[Slide Potentiometer with Plastic Knob - 35mm Long - 10KΩ](https://www.adafruit.com/product/4271)
_Slip slidin' away&nbsp;  
Slip slidin' away&nbsp;  
You know the nearer your resistance&nbsp;  
The more you're slip slidin' away_

If you're tired of the regular-old-twisty potentiometers we carry, why not _slide_ over and try this slide pot?...

In Stock
[Buy Now](https://www.adafruit.com/product/4271)
[Related Guides to the Product](https://learn.adafruit.com/products/4271/guides)
![hand slowly sliding potentiometer back and forth - 35mm Long.](https://cdn-shop.adafruit.com/product-videos/640x480/4271-04.jpg)

Featured
### Half Size Breadboard + 78 Piece 22AWG Jumper Wire Bundle

[Half Size Breadboard + 78 Piece 22AWG Jumper Wire Bundle](https://www.adafruit.com/product/3314)
This is a cute half-size breadboard with an assortment of small jumper wires, great for prototyping. The breadboard is 2.2" x 3.4" (5.5 cm x 8.5 cm) with a standard double-strip in the middle and two power rails on both sides. Power rails can be pulled off easily to make the...

In Stock
[Buy Now](https://www.adafruit.com/product/3314)
[Related Guides to the Product](https://learn.adafruit.com/products/3314/guides)
![Half Size Breadboard and 78 Piece Jumper Wire in various lengths](https://cdn-shop.adafruit.com/640x480/3314-01.jpg)

Or, if you already have jumper wire:

Featured
### Half Sized Premium Breadboard - 400 Tie Points

[Half Sized Premium Breadboard - 400 Tie Points](https://www.adafruit.com/product/64)
This is a cute, half-size breadboard with&nbsp;400 tie points, good for small projects. It's 3.25" x 2.2" / 8.3cm&nbsp;x 5.5cm&nbsp;with a standard double-strip in the middle and two power rails on both sides.&nbsp;You can pull the power rails off easily to make the breadboard as...

In Stock
[Buy Now](https://www.adafruit.com/product/64)
[Related Guides to the Product](https://learn.adafruit.com/products/64/guides)
![Angled shot of half-size solderless breadboard with red and black power lines.](https://cdn-shop.adafruit.com/640x480/64-06.jpg)

Featured
### Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces](https://www.adafruit.com/product/3448)
When working&nbsp;with unusual non-header-friendly surfaces, these handy cables will be your best friends! No longer will you have long, cumbersome strands of alligator clips. These compact jumper cables have a premium male header on one end and a grippy mini alligator clip on the...

In Stock
[Buy Now](https://www.adafruit.com/product/3448)
[Related Guides to the Product](https://learn.adafruit.com/products/3448/guides)
![Group of Small Alligator Clip to Male Jumper Wires](https://cdn-shop.adafruit.com/640x480/3448-00.jpg)

## Optional
Featured
### Adafruit Circuit Playground Express or Bluefruit Enclosure

[Adafruit Circuit Playground Express or Bluefruit Enclosure](https://www.adafruit.com/product/3915)
We've got nice cases for many of our beloved boards, but the [Circuit Playground Express](https://www.adafruit.com/product/3333)&nbsp;and [Circuit Playground&nbsp;Bluefruit](https://www.adafruit.com/product/4333) has been left out of couture enclosure...

In Stock
[Buy Now](https://www.adafruit.com/product/3915)
[Related Guides to the Product](https://learn.adafruit.com/products/3915/guides)
![Top down view of a clear acrylic Adafruit Circuit Playground Express or Bluefruit Enclosure.](https://cdn-shop.adafruit.com/product-videos/640x480/3915-06.jpg)

Featured
### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

[Fully Reversible Pink/Purple USB A to micro B Cable - 1m long](https://www.adafruit.com/product/4111)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save _seconds_ a day by not having to flip the cable around.

First let's talk about the cover and over-molding. We got these...

In Stock
[Buy Now](https://www.adafruit.com/product/4111)
[Related Guides to the Product](https://learn.adafruit.com/products/4111/guides)
![Fully Reversible Pink/Purple USB A to micro B Cable](https://cdn-shop.adafruit.com/640x480/4111-02.jpg)

# Color Remote with Circuit Playground Bluefruit

## CircuitPython on Circuit Playground Bluefruit

# Install or Update CircuitPython

Follow this quick step-by-step to install or update CircuitPython on your Circuit Playground Bluefruit.

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

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

![adafruit_products_CPB_Download_UF2.png](https://cdn-learn.adafruit.com/assets/assets/000/080/530/medium640/adafruit_products_CPB_Download_UF2.png?1567715178)

Plug your Circuit Playground Bluefruit into your computer using a known-good data-capable 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 small **Reset** button in the middle of the CPB (indicated by the red arrow in the image). The ten NeoPixel LEDs will all turn red, and then will all turn green. If they turn all red and stay red, check the USB cable, try another USB port, etc. The little red LED next to the USB connector will pulse red - this is ok!

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

(If double-clicking doesn't do it, try a single-click!)

![adafruit_products_CPB_Front_Reset_Button_Arrow.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/532/medium640/adafruit_products_CPB_Front_Reset_Button_Arrow.jpg?1567715535)

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

&nbsp;

&nbsp;

&nbsp;

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

![adafruit_products_CPB_CPLAYBTBOOT.png](https://cdn-learn.adafruit.com/assets/assets/000/080/533/medium640/adafruit_products_CPB_CPLAYBTBOOT.png?1567715858)

![adafruit_products_CBP_drag_UF2.png](https://cdn-learn.adafruit.com/assets/assets/000/080/534/medium640/adafruit_products_CBP_drag_UF2.png?1567715871)

The LEDs will turn red. Then, the **CPLAYBTBOOT** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

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

![adafruit_products_CBP_CIRCUITPY.png](https://cdn-learn.adafruit.com/assets/assets/000/080/535/medium640/adafruit_products_CBP_CIRCUITPY.png?1567716034)

# Color Remote with Circuit Playground Bluefruit

## Code the Color Remote with CircuitPython

## Libraries

Once you've gotten CircuitPython onto your Circuit Playground Bluefruit boards, it's time to add some libraries. You can [follow this guide page](https://learn.adafruit.com/adafruit-circuit-playground-bluefruit/circuitpython-libraries) for the basics of downloading and transferring libraries to the board.

From the library bundle you downloaded in that guide page, transfer the following libraries onto the CPB boards' **/lib** directories:

- **neopixel.mpy**
- **adafruit\_ble**
- **adafruit\_bluefruit\_connect**

![leds_libraries.jpg](https://cdn-learn.adafruit.com/assets/assets/000/084/084/medium640/leds_libraries.jpg?1573593633)

## Text Editor

Adafruit recommends using the Mu editor for using your CircuitPython code with the Circuit Playground Bluefruit boards. You can get more info in [this guide](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

Alternatively, you can use any text editor that saves files.

## Central

Next we'll code the CPB that will act as the Central/client device. This is the one that will have the slide pots on it and will send out RGB color data packets to the peripheral device.

Copy the code below and paste it into Mu. Then, save it to your CPB as **code.py**.

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

## Peripheral

The second CPB will act as a peripheral device. It will receive the RGB color data packets from the client and update the NeoPixel color to match the data.

Copy the code below and paste it into a new document in Mu, then save it to your second CPB as **code.py**.

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

Next we'll assemble the parts to use our color mixer!

# Color Remote with Circuit Playground Bluefruit

## Build the Color Remote

![](https://cdn-learn.adafruit.com/assets/assets/000/082/533/medium800/leds_cpb_colormix_fritz.png?1571426253)

I love using slide potentiometers (a.k.a. faders) for this type of project, because at a glance you can tell how much of each color is selected. One problem that can arise, however, when using slide pots, is that they don't usually fit easily on a breadboard or perma proto board. These adorable little 35mm faders solve this problem! Since the bottom pin that is labeled "3" is the ground pin, all of the faders can share the common ground rail on the breadboard!

![](https://cdn-learn.adafruit.com/assets/assets/000/082/527/medium800/leds_IMG_6833.jpg?1571425437)

## Slide Pots

Each slide potentiometer will act as a voltage divider, with the Circuit Playground Bluefruit analog pins reading the wiper's varying output.

The pin assignments are as follows:

- **Pin 1 = 3.3VDC**
- **Pin 2 = wiper (to analog input)**
- **Pin 3 = ground**

Insert the three slide potentiometers into the breadboard as shown. You want the **pin**  **3** legs of all three pots to be placed into the **ground** rail (next to the blue line).

Insert pins **1** and **2** so there is a free row of breadboard pins above them, this is where you'll make the wired connections to the CPB.

&nbsp;

![leds_IMG_6834.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/528/medium640/leds_IMG_6834.jpg?1571425460)

![leds_IMG_6835.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/529/medium640/leds_IMG_6835.jpg?1571425467)

![](https://cdn-learn.adafruit.com/assets/assets/000/082/531/medium800/leds_IMG_6836.jpg?1571426072)

## Wiring to Voltage

Use three small jumper wires (sometimes called "staples") to connect the **pin 1** of each slide pot to the red **+V** rail of the breadboard as shown here. Looking from the top down, **pin 1** is the pin on the left at the top of each slide pot.

![](https://cdn-learn.adafruit.com/assets/assets/000/082/532/medium800/leds_IMG_6837.jpg?1571426212)

## Connections to Circuit Playground Bluefruit

Now we can use alligator clip leads with male header pins to connect the sliders to the CPB.

Insert the **red lead** into the breadboard's top red **+V** rail.

Insert the **black lead** into the breadboard's bottom black **ground** rail.

Insert the **yellow lead** into the left slider's **pin 2** column on the breadboard.

Insert the **green lead** into the middle slider's **pin 2** column on the breadboard.

Insert the **blue lead** into the right slider's **pin 2** column on the breadboard.

Now, you can connect the alligator clips to the associated pads on the Circuit Playground Bluefruit:

- **red to 3.3V**
- **black to GND**
- **yellow to A4**
- **green to A5**
- **blue to A6**

![leds_IMG_6838.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/548/medium640/leds_IMG_6838.jpg?1571428060)

![leds_IMG_6840.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/549/medium640/leds_IMG_6840.jpg?1571428077)

![leds_IMG_6841.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/550/medium640/leds_IMG_6841.jpg?1571428087)

![leds_IMG_6842.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/551/medium640/leds_IMG_6842.jpg?1571428102)

![leds_IMG_6843.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/552/medium640/leds_IMG_6843.jpg?1571428117)

## Power

You can now power up the Circuit Playground Bluefruit boards -- here I've used 3.7VDC LiPoly batteries plugged into the battery JST-SH ports. You can also use AA or AAA battery packs, or power over the USB port.

![](https://cdn-learn.adafruit.com/assets/assets/000/082/553/medium800/leds_IMG_6844.jpg?1571428140)

## Remote Color Mixing

After a moment, the two boards will start up, and the mixer CPB will begin sending Bluetooth LE packets containing RGB color data based on the slider positions. The other CPB will listen for those packets and light up its NeoPixels in accordance with the RGB values.

Here you can see each slider used individually for pure red, green, and blue values, and then a mix of partial red and blue for a pink color. Try different combinations to mix your own colors!

![leds_IMG_6845.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/541/medium640/leds_IMG_6845.jpg?1571426892)

![leds_IMG_6846.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/542/medium640/leds_IMG_6846.jpg?1571426899)

![leds_IMG_6847.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/543/medium640/leds_IMG_6847.jpg?1571426907)

![leds_IMG_6848.jpg](https://cdn-learn.adafruit.com/assets/assets/000/082/544/medium640/leds_IMG_6848.jpg?1571426914)

![](https://cdn-learn.adafruit.com/assets/assets/000/082/545/medium800thumb/leds_mixdemo.jpg?1571427595)

https://youtu.be/dZ388vKMHB8


## Guide Products

### Circuit Playground Bluefruit - Bluetooth® Low Energy

[Circuit Playground Bluefruit - Bluetooth® Low Energy](https://www.adafruit.com/product/4333)
 **Circuit Playground Bluefruit** is our third board in the Circuit Playground series, another step towards a perfect introduction to electronics and programming. We've taken the popular Circuit Playground Express and made it even better! Now the main chip is an nRF52840...

In Stock
[Buy Now](https://www.adafruit.com/product/4333)
[Related Guides to the Product](https://learn.adafruit.com/products/4333/guides)
### Slide Potentiometer with Plastic Knob - 35mm Long - 10KΩ

[Slide Potentiometer with Plastic Knob - 35mm Long - 10KΩ](https://www.adafruit.com/product/4271)
_Slip slidin' away&nbsp;  
Slip slidin' away&nbsp;  
You know the nearer your resistance&nbsp;  
The more you're slip slidin' away_

If you're tired of the regular-old-twisty potentiometers we carry, why not _slide_ over and try this slide pot?...

In Stock
[Buy Now](https://www.adafruit.com/product/4271)
[Related Guides to the Product](https://learn.adafruit.com/products/4271/guides)
### Half Size Breadboard + 78 Piece 22AWG Jumper Wire Bundle

[Half Size Breadboard + 78 Piece 22AWG Jumper Wire Bundle](https://www.adafruit.com/product/3314)
This is a cute half-size breadboard with an assortment of small jumper wires, great for prototyping. The breadboard is 2.2" x 3.4" (5.5 cm x 8.5 cm) with a standard double-strip in the middle and two power rails on both sides. Power rails can be pulled off easily to make the...

In Stock
[Buy Now](https://www.adafruit.com/product/3314)
[Related Guides to the Product](https://learn.adafruit.com/products/3314/guides)
### Half Sized Premium Breadboard - 400 Tie Points

[Half Sized Premium Breadboard - 400 Tie Points](https://www.adafruit.com/product/64)
This is a cute, half-size breadboard with&nbsp;400 tie points, good for small projects. It's 3.25" x 2.2" / 8.3cm&nbsp;x 5.5cm&nbsp;with a standard double-strip in the middle and two power rails on both sides.&nbsp;You can pull the power rails off easily to make the breadboard as...

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

[Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces](https://www.adafruit.com/product/3448)
When working&nbsp;with unusual non-header-friendly surfaces, these handy cables will be your best friends! No longer will you have long, cumbersome strands of alligator clips. These compact jumper cables have a premium male header on one end and a grippy mini alligator clip on the...

In Stock
[Buy Now](https://www.adafruit.com/product/3448)
[Related Guides to the Product](https://learn.adafruit.com/products/3448/guides)
### Adafruit Circuit Playground Express or Bluefruit Enclosure

[Adafruit Circuit Playground Express or Bluefruit Enclosure](https://www.adafruit.com/product/3915)
We've got nice cases for many of our beloved boards, but the [Circuit Playground Express](https://www.adafruit.com/product/3333)&nbsp;and [Circuit Playground&nbsp;Bluefruit](https://www.adafruit.com/product/4333) has been left out of couture enclosure...

In Stock
[Buy Now](https://www.adafruit.com/product/3915)
[Related Guides to the Product](https://learn.adafruit.com/products/3915/guides)
### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

[Fully Reversible Pink/Purple USB A to micro B Cable - 1m long](https://www.adafruit.com/product/4111)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save _seconds_ a day by not having to flip the cable around.

First let's talk about the cover and over-molding. We got these...

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

## Related Guides

- [Adafruit Circuit Playground Bluefruit](https://learn.adafruit.com/adafruit-circuit-playground-bluefruit.md)
- [RP2040 RunCPM Emulator with USB Keyboard & HDMI screen](https://learn.adafruit.com/rp2040-runcpm-emulator-with-usb-keyboard-hdmi-screen.md)
- [Circuit Playground Bluetooth Cauldron](https://learn.adafruit.com/cpx-cauldron.md)
- [CircuitPython Libraries with the Binho Nova Multi-Protocol USB Host Adapter](https://learn.adafruit.com/circuitpython-with-binho-nova-multi-protocol-usb-host-adapter.md)
- [Adafruit HUZZAH32 - ESP32 Feather](https://learn.adafruit.com/adafruit-huzzah32-esp32-feather.md)
- [Circuit Playground Express Automatic Sunglasses](https://learn.adafruit.com/circuit-playground-express-auto-sunglasses.md)
- [Green Goblin Pumpkin CPB Ornament](https://learn.adafruit.com/green-goblin-pumpkin-cpb-ornament.md)
- [Cartoon Network MakeCode: Garnet's Gauntlets from Steven Universe](https://learn.adafruit.com/cartoon-network-makecode-garnets-gauntlets-from-steven-universe.md)
- [Square NeoPixel Display with Black LED Acrylic](https://learn.adafruit.com/sqaure-neopixel-display-with-black-led-acrylic.md)
- [Adafruit Circuit Playground Tri-Color E-Ink Gizmo](https://learn.adafruit.com/adafruit-circuit-playground-tri-color-e-ink-gizmo.md)
- [Make It Bubble](https://learn.adafruit.com/make-it-bubble.md)
- [Using QMK on RP2040 Microcontrollers](https://learn.adafruit.com/using-qmk-on-rp2040-microcontrollers.md)
- [LED Shoji Lamp](https://learn.adafruit.com/led-shoji-lamp.md)
- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Turtle Graphics in CircuitPython on TFT Gizmo](https://learn.adafruit.com/turtle-graphics-gizmo.md)
- [A Floppy Thumb Drive with a Color File Icon Display](https://learn.adafruit.com/a-floppy-thumb-drive-with-a-color-file-icon-display.md)
