# Circuit Playground Bluefruit NeoPixel Animation and Color Remote Control

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/085/743/medium800thumb/leds_CPB_NeoPixel_Controller_Sparkle_large.jpg?1576162468)

The Circuit Playground Bluefruit has all kinds of features built in, including NeoPixels, an accelerometer, two buttons, alligator-clip-friendly pads and Bluetooth Low Energy (BLE). This project uses these features to create a wireless NeoPixel animation and color remote control using CircuitPython. CircuitPython is a version of Python designed to run on microcontrollers like the Circuit Playground Bluefruit.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/779/medium800/leds_CPB_NeoPIxel_Controller_Assembled.jpg?1576186974)

You'll need two Circuit Playground Bluefruit (CPB) boards, an alligator-clip NeoPixel strip or two, and two batteries. You'll connect the NeoPixel strip(s) to the NeoPixel Animator CPB, and use the other as the Remote Control. This guide will show you how to connect everything up, and load the software onto the CPBs. It will walk you through using your Remote Control CPB to change the colors and animations running on the NeoPixels connected to the NeoPixel Animator CPB. Let's get started!

## Parts
### 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...

Out of 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)

### Adafruit NeoPixel LED Strip w/ Alligator Clips - 60 LED/m

[Adafruit NeoPixel LED Strip w/ Alligator Clips - 60 LED/m](https://www.adafruit.com/product/3811)
Adding glowy color to your projects has never been easier: no more soldering or stripping wires, clip 'em on and glow! This **Adafruit NeoPixel LED Strip with Alligator Clips** has **30 total LEDs** in a **"60 LED per meter" spacing** , and...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3811)
[Related Guides to the Product](https://learn.adafruit.com/products/3811/guides)
![Adafruit NeoPixel LED 0.5 meter Strip with Alligator Clips wired to Circuit Playground, lighting up rainbow](https://cdn-shop.adafruit.com/product-videos/640x480/3811-06.jpg)

### Lithium Ion Battery Pack - 3.7V 6600mAh

[Lithium Ion Battery Pack - 3.7V 6600mAh](https://www.adafruit.com/product/353)
Need a massive battery for your project? This lithium-ion pack is made of 3 balanced 2200mAh cells for a total of 6600mA capacity! The cells are connected in parallel and spot-welded to a protection circuit that provides over-voltage, under-voltage, and over-current protection.

Each cell...

Out of Stock
[Buy Now](https://www.adafruit.com/product/353)
[Related Guides to the Product](https://learn.adafruit.com/products/353/guides)
![Lithium Ion Battery Pack with three round cells 3.7V 6600mAh with JST PH connector](https://cdn-shop.adafruit.com/640x480/353-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)

### 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)

# Additional Items

You may also want to pick up the following:

- **zip ties** - to secure the NeoPixel Strips, larger battery, and NeoPixel Animator CPB to your project
- **double-sided tape** - to attach the smaller battery to the back of the Remote Control CPB

These items are optional, but come in super handy!

# Circuit Playground Bluefruit NeoPixel Animation and Color Remote Control

## 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)

# Circuit Playground Bluefruit NeoPixel Animation and Color Remote Control

## Circuit Playground Bluefruit CircuitPython Libraries

The Circuit Playground Bluefruit is packed full of features like Bluetooth and NeoPixel LEDs. Now that you have CircuitPython installed on your Circuit Playground Bluefruit, you'll need to install a base set of CircuitPython libraries to use the features of the board with CircuitPython.

Follow these steps to get the necessary libraries installed.

# Installing CircuitPython Libraries on Circuit Playground Bluefruit

If you do not already have a **lib** folder on your **CIRCUITPY** drive, create one now.

Then, download the CircuitPython library bundle that matches your version of CircuitPython from CircuitPython.org.

[Download the latest library bundle from circuitpython.org](https://circuitpython.org/libraries)
The bundle download as a .zip file. Extract the file. Open the resulting folder.

![adafruit_products_CPB_Download_extract_bundle.png](https://cdn-learn.adafruit.com/assets/assets/000/085/257/medium640/adafruit_products_CPB_Download_extract_bundle.png?1575320201)

Open the **lib** folder found within.

![adafruit_products_CPB_open_lib_folder_in_bundle.png](https://cdn-learn.adafruit.com/assets/assets/000/085/258/medium640/adafruit_products_CPB_open_lib_folder_in_bundle.png?1575320665)

Once inside, you'll find a lengthy list of folders and .mpy files. To install a CircuitPython library, you drag the file or folder from the **bundle lib folder** to **the lib folder on your CIRCUITPY drive**.

![adafruit_products_CPB_bundle_lib_folder_contents.png](https://cdn-learn.adafruit.com/assets/assets/000/085/259/medium640/adafruit_products_CPB_bundle_lib_folder_contents.png?1575320747)

Copy the following folders and files **from the bundle lib folder** to **the**  **lib folder on your CIRCUITPY drive** :

- **adafruit\_ble**
- **adafruit\_bluefruit\_connect**
- **adafruit\_bus\_device**
- **adafruit\_circuitplayground**
- **adafruit\_gizmo**
- **adafruit\_hid**
- **adafruit\_lis3dh.mpy**
- **adafruit\_thermistor.mpy**
- **neopixel.mpy**

Your lib folder should look like the image on the left.

![adafruit_products_Circuit_Playground_Bluefruit_Libraries_List.png](https://cdn-learn.adafruit.com/assets/assets/000/085/694/medium640/adafruit_products_Circuit_Playground_Bluefruit_Libraries_List.png?1576092065)

Now you're all set to use CircuitPython with the features of the Circuit Playground Bluefruit!

# Circuit Playground Bluefruit NeoPixel Animation and Color Remote Control

## Assembly

Assembling this project is super simple. No soldering required! Simply connect the alligator clips on the NeoPixel strip to the correct Circuit Playground Bluefruit alligator-clip-friendly pads.

You can optionally include the [Adafruit Circuit Playground Enclosure](https://www.adafruit.com/product/3915). To use the enclosure with the Remote Control, simply snap it onto a Circuit Playground Bluefruit. If you'd like to use the enclosure with the NeoPixel Animator, snap it onto the CPB before attaching the NeoPixel strip alligator clips to the pads.

## Single NeoPixel Strip

To complete this project with one NeoPixel strip, connect the NeoPixel Animator CPB and NeoPixel strip up as follows:

- **Bluefruit GND** to **NeoPixel GND (black wire/clip)**
- **Bluefruit A1** to **NeoPixel DIN (white wire/clip)**
- **Bluefruit VOUT** to **NeoPixel 5V (red wire/clip)**

![leds_CPB_NeoPIxel_alligator_strip_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/085/415/medium640/leds_CPB_NeoPIxel_alligator_strip_bb.png?1575579527)

## Two NeoPixel Strips

You can easily add a second NeoPixel strip to this project. If you connect them both as suggested, there are no changes needed to the code. To complete this project with two NeoPixel strips, connect them up as follows.

The two ground wires can be connected to separate pads as there are multiple GNDs on the Bluefruit. The 5V and NeoPixel data clips need to be connected to the same pins for both strips. After experimentation, the most stable connection is achieved when clipping the alligator clips on the second strip to the alligator clips on the first.

- **Bluefruit GND** to **NeoPixel strip 1 GND (black wire/clip)**
- **Bluefruit A1** to **NeoPixel strip 1 DIN (white wire/clip)**
- **Bluefruit VOUT** to **NeoPixel strip 1 5V (red wire/clip)**
- **Bluefruit GND** to **NeoPixel strip 2 GND (black wire/clip)**
- **NeoPixel strip 2 DIN (white wire/clip)** to **NeoPixel strip 1 DIN (white wire/clip)**
- **NeoPixel strip 2 5V (red wire/clip)** to **NeoPixel strip 1 5V (red wire/clip)**

![leds_CPB_NeoPixel_alligator_two_strips_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/085/416/medium640/leds_CPB_NeoPixel_alligator_two_strips_bb.png?1575579761)

The first image shows the 5V red alligator clip on the second strip clipped to the 5V alligator clip on the first strip, not attached to the Circuit Playground Bluefruit. Slide the cover back on the clip on the first strip, and attach the second strip by clipping onto the first clip below the teeth.

The second and third images show both strips attached to the Circuit Playground Bluefruit.

![leds_CPB_NeoPIxel_Controller_gator_clip_to_gator_clip_disconnected.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/775/medium640/leds_CPB_NeoPIxel_Controller_gator_clip_to_gator_clip_disconnected.jpg?1576186427)

![leds_CPB_NeoPIxel_Controller_two_strips_clipped_CPB_close.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/776/medium640/leds_CPB_NeoPIxel_Controller_two_strips_clipped_CPB_close.jpg?1576186472)

![leds_CPB_NeoPIxel_Controller_gator_clips_close_up_on_wreath.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/777/medium640/leds_CPB_NeoPIxel_Controller_gator_clips_close_up_on_wreath.jpg?1576186692)

Now you can decorate anything with it, including a wreath, tree or garland! We'll cover the craft aspect of this project further at the end of the guide.

Now that everything is connected, it's time to move on to the code!

# Circuit Playground Bluefruit NeoPixel Animation and Color Remote Control

## CircuitPython Setup and Code

![](https://cdn-learn.adafruit.com/assets/assets/000/085/778/medium800/leds_CPB_NeoPIxel_Controller_Wreath_and_Controller_Lit_Up.jpg?1576186940)

This project uses two Circuit Playground Bluefruit boards. One acts as the Remote Control, the other as the NeoPixel Animator. There are two separate pieces of code used in this project: one for the remote control, and one for the NeoPixel animator. You'll load each piece of code onto a separate Circuit Playground Bluefruit.

**This project requires the latest version of CircuitPython!** Be sure to follow the instructions found on the [CircuitPython on Circuit Playground Bluefruit page](https://learn.adafruit.com/circuit-playground-bluefruit-neopixel-controller/circuitpython-on-circuit-playground-bluefruit) to download the latest version before continuing.

**For this code to work, you'll need to install the necessary libraries first.** Follow the instructions on the [Circuit Playground Bluefruit CircuitPython Libraries page](https://learn.adafruit.com/circuit-playground-bluefruit-neopixel-controller/circuit-playground-bluefruit-circuitpython-libraries), and then continue with the instructions in the next section.

## Installing CircuitPython LED Animation Library

In addition to the libraries listed on the [Circuit Playground Bluefruit CircuitPython Libraries page](https://learn.adafruit.com/circuit-playground-bluefruit-neopixel-controller/circuit-playground-bluefruit-circuitpython-libraries), this project requires one more library to work. Follow the same instructions found on the [Libraries page](https://learn.adafruit.com/circuit-playground-bluefruit-neopixel-controller/circuit-playground-bluefruit-circuitpython-libraries), and include the Adafruit CircuitPython LED Animation library as well.

To install the Adafruit CircuitPython LED Animation library, drag the following folder out of the CircuitPython library bundle lib folder to the **lib** folder on your **CIRCUITPY** drive:

- **adafruit\_led\_animation**

Before continuing, ensure you have **ALL** of the files and folders mentioned on the [Circuit Playground Bluefruit CircuitPython Libraries page](https://learn.adafruit.com/circuit-playground-bluefruit-neopixel-controller/circuit-playground-bluefruit-circuitpython-libraries?preview_token=t_S2kID0Iv0nO1nrh9x90Q#step-3048354) **AND** the **adafruit\_led\_animation** folder in the **lib** folder on your **CIRCUITPY** drive.

![leds_CPB_NeoPixel_Controller_CIRCUITPY_Contents.png](https://cdn-learn.adafruit.com/assets/assets/000/085/690/medium640/leds_CPB_NeoPixel_Controller_CIRCUITPY_Contents.png?1576091273)

## CircuitPython Code

Download the following file and save it as **code.py** to the Circuit Playground Bluefruit you'll be using as the Remote Control:

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

Download the following file and save it as **code.py** to the Circuit Playground Bluefruit you'll be using as the NeoPixel Animator, i.e. the CPB with the NeoPixel strip(s) connected to it:

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

The next section shows you how to use the Remote Control Circuit Playground Bluefruit with the NeoPixel Animator Circuit Playground Bluefruit to change color and animations. Check it out!

# Circuit Playground Bluefruit NeoPixel Animation and Color Remote Control

## Using Remote Control with NeoPixel Animator

Once you have the code loaded on both Circuit Playground Bluefruit boards, you should see the NeoPixel Animator start blinking the initial color chosen in setup, which defaults to red. Now you're ready to connect to the Remote Control.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/711/medium800thumb/leds_CPB_NeoPixel_Controller_Blink_Red.jpg?1576101239)

Power up the Remote Control. The little green power LED on the Remote Control CPB will show that it has been powered on. Wait for the Remote Control and the NeoPixel Animator to connect.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/744/medium800/leds_CPB_NeoPixel_Controller_Remote_Control_Power_On.jpg?1576163096)

Once they have connected, the LEDs will light up on the Remote Control and the color on the NeoPixel Animator will update to match the color on the Remote control.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/729/medium800thumb/leds_CPB_NeoPixel_Controller_Remote_Connecting_to_Animator.jpg?1576116007)

Try moving the Remote Control around in different orientations to see the NeoPixel color on the Remote Control and the NeoPixel Animator change!

![](https://cdn-learn.adafruit.com/assets/assets/000/085/730/medium800thumb/leds_CPB_NeoPixel_Controller_Change_Color.jpg?1576116182)

To switch between animations, press button A (the left button). The second animation is the Comet animation.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/731/medium800thumb/leds_CPB_NeoPixel_Controller_Comet.jpg?1576116622)

Press button A again to proceed to the next animation. The third animation is the Sparkle animation. You can continue to change the color, regardless of what animation is running.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/737/medium800thumb/leds_CPB_NeoPixel_Controller_Sparkle.jpg?1576116977)

Press button A again to return to the Blink animation.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/733/medium800thumb/leds_CPB_NeoPixel_Controller_Sparkle_to_Blink.jpg?1576116925)

If you find a color you particularly like, you can freeze the NeoPixel Animator LEDs as that color by pressing button B (the right button). While the color is frozen, you can still cycle through the different animations. The NeoPixels on the Remote Control will continue to change color, and when you unfreeze the color, the NeoPixel Animator will update to the color currently on the Remote Control.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/738/medium800thumb/leds_CPB_NeoPixel_Controller_Color_Freeze.jpg?1576117099)

To conserve power, you can turn off the LEDs on both the Remote Control and the NeoPixel Animator by moving the slide switch to the left. To turn the LEDs back on, simply move the slide switch back to the right. Note: if you start up the Remote Control with the slide switch to the left, the LEDs on both the Remote Control and the NeoPixel Animator will turn off - if you can't get the LEDs to turn on, make sure the switch on the Remote Control is to the right before trying to troubleshoot anything else.

![](https://cdn-learn.adafruit.com/assets/assets/000/085/732/medium800thumb/leds_CPB_NeoPixel_Controller_LEDs_Off.jpg?1576116780)

In the next two sections, we'll take an in-depth look at each example to see how they work - first the remote control code and then the NeoPixel animator code. Let's get started!

# Circuit Playground Bluefruit NeoPixel Animation and Color Remote Control

## Remote Control Code

![](https://cdn-learn.adafruit.com/assets/assets/000/085/740/medium800/leds_CPB_NeoPixel_Controller_Remote_Control_Close_Up.jpg?1576161416)

This project involves two Circuit Playground Bluefruit boards. The first acts as the Remote Control which sends data to the NeoPixel Animator which is used to cycle through animations, change the color, freeze the color, and turn on and off the LEDs. This section will go through the Remote Control code. Let's take a look!

## Library Imports

First we import all the necessary libraries and modules.

```python
import time

from adafruit_circuitplayground.bluefruit import cpb

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService
from adafruit_bluefruit_connect.color_packet import ColorPacket
from adafruit_bluefruit_connect.button_packet import ButtonPacket
```

We'll be able to call on Circuit Playground Bluefruit board functions with the `cpb` command, including simplified ways to access the buttons and switch, the accelerometer, and the built-in NeoPixels.

We import all the necessary BLE modules for connecting to another Bluefruit, and the modules to be able to send color packets and button packets. We'll use the color packets to send color information to and change the color of the LEDs on the NeoPixel Animator CPB, and the button packets to send button presses and slide switch changes to the NeoPixel Animator CPB to change animations or turn off the LEDs.

## Helper Functions

Then we have two helper functions: `scale()` and `send_packet()`.

The first helper scales the acceleration value range provided by the built-in accelerometer to a 0-255 RGB color range. This allows us to use the accelerometer to change the color of the NeoPixels.

```python
def scale(value):
    """Scale a value from acceleration value range to 0-255 (RGB range)"""
    value = abs(value)
    value = max(min(19.6, value), 0)
    return int(value / 19.6 * 255)
```

The second helper handles sending BLE packets to another Bluefruit over a UART connection. BLE connections can be flaky for a multitude of reasons, and if the connection drops while sending packets, the code will return an error and stop running. Therefore, we have this helper function to do error handling on the packet sending code so your code continues running even if there are connection issues.

```python
def send_packet(uart_connection_name, packet):
    """Returns False if no longer connected."""
    try:
        uart_connection_name[UARTService].write(packet.to_bytes())
    except:  # pylint: disable=bare-except
        try:
            uart_connection_name.disconnect()
        except:  # pylint: disable=bare-except
            pass
        return False
    return True
```

## Bluetooth and Input Setup

We finish setup by creating the BLE object, creating a series of variables to use in preventing multiple button presses being sent and tracking the last switch location, and then check to see if any existing BLE connections are valid for our purposes.

```python
ble = BLERadio()

# Setup for preventing repeated button presses and tracking switch state
button_a_pressed = False
button_b_pressed = False
last_switch_state = None

uart_connection = None
# See if any existing connections are providing UARTService.
if ble.connected:
    for connection in ble.connections:
        if UARTService in connection:
            uart_connection = connection
        break
```

## Scanning for BLE Connections

If the board is not already connected via BLE, the first thing it does is begin scanning for any valid options and connects to the first one it finds.

```python
[...]
    if not uart_connection or not uart_connection.connected:  # If not connected...
        print("Scanning...")
        for adv in ble.start_scan(ProvideServicesAdvertisement, timeout=5):  # Scan...
            if UARTService in adv.services:  # If UARTService found...
                print("Found a UARTService advertisement.")
                uart_connection = ble.connect(adv)  # Create a UART connection...
                break
        # Stop scanning whether or not we are connected.
        ble.stop_scan()  # And stop scanning.
```

Once connected, it moves on to the rest of the code. While the Circuit Playground Bluefruit is connected, you can do a few things: send button presses from button A and button B, send the location of the slide switch, and use the accelerometer to change and send the color of the NeoPixels.

## Button Presses

The code for button A and button B is essentially the same. Let's take a look at button A.

Remember, during setup we set&nbsp;`button_a_pressed = False` to set the initial state.

First the code checks to see if BOTH button A is pressed and `button_a_pressed = False`, and then sends a `LEFT` button packet and sets `button_a_pressed = True`.

```python
[...]
        if cpb.button_a and not button_a_pressed:  # If button A pressed...
            print("Button A pressed.")
            # Send a LEFT button packet.
            if not send_packet(uart_connection,
                               ButtonPacket(ButtonPacket.LEFT, pressed=True)):
                uart_connection = None
                continue
            button_a_pressed = True  # Set to True.
            time.sleep(0.05)  # Debounce.
```

Then it checks to see if the button has been released by BOTH checking to see if button a is not currently being pressed and that `button_a_pressed = True`, and sets `button_a_pressed = False` again.

```python
[...]
        if not cpb.button_a and button_a_pressed:  # On button release...
            button_a_pressed = False  # Set to False.
            time.sleep(0.05)  # Debounce.
```

The code for button B is identical except that it sends a `RIGHT` button packet instead.

This set of code prevents accidentally sending multiple button presses by holding down the buttons. This is important for the NeoPixel Animator code, as the button presses are used to switch animations and freeze the color.

## Slide Switch

The slide switch works a little differently than the buttons since it can remain in either state for an extended period of time without physical interaction. So instead of simply tracking the state, we're checking to see when the state changes, since that is the important part.

So, we check to see if the switch state is no longer the last switch state, i.e. it has changed since the last check. If it has changed, we set `last_switch_state` to the current state. We `print` to the serial console a message that depends on the switch direction. Each time the switch position changes, we send a `BUTTON_1` packet.

```python
[...]
        if cpb.switch is not last_switch_state:  # If the switch state is changed...
            last_switch_state = cpb.switch  # Set state to current switch state.
            if cpb.switch:
                print("Switch is to the left: LEDs off!")
            else:
                print("Switch is to the right: LEDs on!")
            # Send a BUTTON_1 button packet.
            if not send_packet(uart_connection,
                               ButtonPacket(ButtonPacket.BUTTON_1, pressed=cpb.switch)):
                uart_connection = None
                continue
```

On the Remote Control Circuit Playground Bluefruit, if the switch is to the left, we turn off the NeoPixels.

```python
[...]
        if cpb.switch:  # If switch is to the left...
            cpb.pixels.fill((0, 0, 0))  # Turn off the LEDs.
```

This is because the switch being to the left also turns off the NeoPixels on the NeoPixel Animator CPB.

## Acceleration and NeoPixel Color

Finally, if the slide switch is to the right, we use the accelerometer to set the NeoPixel colors and send that data to the NeoPixel Animator CPB.

First, we set `r, g, b` to&nbsp; the acceleration values mapped to RGB values using the `scale` helper function. We set `color = (r, g, b)` and fill the Remote Control NeoPixels with the color. Then, we send a color packet with the color to the NeoPixel Animator. As long as the switch is to the right, color packets are being sent.

```python
[...]
            r, g, b = map(scale, cpb.acceleration)  # Map acceleration values to RGB values...
            color = (r, g, b)  # Set color to current mapped RGB value...
            print("Color:", color)
            cpb.pixels.fill(color)  # Fill Remote Control LEDs with current color...
            if not send_packet(uart_connection, ColorPacket(color)):  # And send a color packet.
                uart_connection = None
                continue
        time.sleep(0.1)  # Delay to prevent sending packets too quickly.
```

We end with a `time.sleep(0.1)` to prevent packets from sending too quickly and being received as corrupted.

That's how the Remote Control code for the Circuit Playground Bluefruit Animation and Color Remote Control works!

# Circuit Playground Bluefruit NeoPixel Animation and Color Remote Control

## NeoPixel Animator Code

![](https://cdn-learn.adafruit.com/assets/assets/000/085/741/medium800/leds_CPB_NeoPixel_Controller_NeoPixel_Animator_Close_Up.jpg?1576161431)

This project involves two Circuit Playground Bluefruit boards. The second acts as the NeoPixel Animator which receives data from the Remote Control which is used to cycle through animations, change the color, freeze the color, and turn on and off the LEDs. This section will go through the NeoPixel Animator code. Let's take a look!

## Library Imports

First we import all the necessary libraries and modules.

```python
import board
import neopixel
from adafruit_circuitplayground.bluefruit import cpb
from adafruit_led_animation.animation.blink import Blink
from adafruit_led_animation.animation.comet import Comet
from adafruit_led_animation.animation.sparkle import Sparkle
from adafruit_led_animation.group import AnimationGroup
from adafruit_led_animation.sequence import AnimationSequence
import adafruit_led_animation.color as color

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService

from adafruit_bluefruit_connect.packet import Packet
from adafruit_bluefruit_connect.color_packet import ColorPacket
from adafruit_bluefruit_connect.button_packet import ButtonPacket
```

The first two are needed to set up the external NeoPixel strip(s).

We'll be able to call on Circuit Playground Bluefruit board functions with the `cpb` command, including simplified ways to access the built-in NeoPixels.

We'll use the Adafruit CircuitPython LED Animation library to display the Blink, Comet and Sparkle animations using animation groups and animation sequence. We'll also use it to set the initial animation color.

Then we import all the necessary libraries for connecting to another Bluefruit, and the modules to be able to receive and interpret color packets and button packets. We'll use the color packets to receive data from the Remote Control CPB and set the NeoPixel color based on that data, and button packets to change the animations and freeze the color of the NeoPixels.

## Customisations

There are a number of features of the animations that you can customise to your liking. This section of code contains all of the customisable options.

First, set the number of pixels in your externally connected NeoPixel strip. The default is `30`. If you are using two strips connected to the same pin, count the length of both strips only once, i.e. if you have two strips of length 30 attached to pin A1, your `STRIP_PIXEL_NUMBER` will be 30.

```python
# The number of NeoPixels in the externally attached strip
# If using two strips connected to the same pin, count only one strip for this number!
STRIP_PIXEL_NUMBER = 30
```

The first animation in the cycle is Blink. This is the only animation that the color really matters for as it is the only animation that occurs when there is not another Circuit Playground Bluefruit connected and sending color data. You can set the blink speed and color here. Speed defaults to 0.5 seconds. The color defaults to red.

```python
# Setup for blink animation
BLINK_SPEED = 0.5  # Lower numbers increase the animation speed
BLINK_INITIAL_COLOR = color.RED  # Color before Remote Control is connected
```

Some of the color options available in the LED Animation library are: RED, YELLOW, ORANGE, GREEN, TEAL, CYAN, BLUE, PURPLE, MAGENTA, WHITE, GOLD, PINK, AQUA, JADE, AMBER.

Next is the setup for the comet animation. First you can set the comet speed. Default is 0.03 seconds. Next you can set the tail length of the comet animating on the Circuit Playground Bluefruit - this comet defaults to a length of 5. Then you can set the tail length of the comet animating on the NeoPixel strip(s) - this comet defaults to a length of 15.

The comet animation has an option to "bounce" which means when it completes animating in one direction, it returns the other direction. You can set whether or not the comet animations bounce. The comet on the Bluefruit defaults to not bouncing. The comet on the strip(s) defaults to bouncing. Set these to True or False depending on whether you want it to bounce or not.

```python
# Setup for comet animation
COMET_SPEED = 0.03  # Lower numbers increase the animation speed
CPB_COMET_TAIL_LENGTH = 5  # The length of the comet on the Circuit Playground Bluefruit
STRIP_COMET_TAIL_LENGTH = 15  # The length of the comet on the NeoPixel strip
CPB_COMET_BOUNCE = False  # Set to True to make the comet "bounce" the opposite direction on CPB
STRIP_COMET_BOUNCE = True  # Set to False to stop comet from "bouncing" on NeoPixel strip
```

Last is the setup for the sparkle animation. The only thing to set here is sparkle speed. It defaults to 0.03 seconds.

```python
# Setup for sparkle animation
SPARKLE_SPEED = 0.03  # Lower numbers increase the animation speed
```

## NeoPixel Strip and Bluetooth Setup

Next we create the NeoPixel strip object. If you're using two strips connected to the same pin, you still only need one strip object as it treats them both as the same strip.

```python
strip_pixels = neopixel.NeoPixel(board.A1, STRIP_PIXEL_NUMBER, auto_write=False)
```

Then we create the BLE, UART service, and advertisement objects.

```python
ble = BLERadio()
uart = UARTService()
advertisement = ProvideServicesAdvertisement(uart)
```

## Animations

Next we create an animation sequence made up of animation groups. Animation sequences allow you to cycle through multiple animations, such as Blink, Comet and Sparkle. Animation groups allow you to animate on multiple LED objects at the same time, in this case, the built-in NeoPixels on the Bluefruit and the externally connected NeoPixel strip(s).

This animation sequence is made up of three animation groups. Each group contains two instances of one of three animations, grouped together by animation type. Within the groups, two animations objects are created for each of the three animations - one for the Circuit Playground Bluefruit as `cpb.pixels`, and one for the external NeoPixel strip(s) as `strip_pixels`. Each animation object includes the necessary information for setup, e.g. for Blink, you provide the pixel object, the speed and the initial color.

```python
animations = AnimationSequence(
    AnimationGroup(
        Blink(cpb.pixels, BLINK_SPEED, BLINK_INITIAL_COLOR),
        Blink(strip_pixels, BLINK_SPEED, BLINK_INITIAL_COLOR),
        sync=True
    ),
    AnimationGroup(
        Comet(cpb.pixels, COMET_SPEED, COMET_INITIAL_COLOR, tail_length=CPB_COMET_TAIL_LENGTH,
              bounce=CPB_COMET_BOUNCE),
        Comet(strip_pixels, COMET_SPEED, COMET_INITIAL_COLOR, tail_length=STRIP_COMET_TAIL_LENGTH,
              bounce=STRIP_COMET_BOUNCE)
    ),
    AnimationGroup(
        Sparkle(cpb.pixels, SPARKLE_SPEED, SPARKLE_INITIAL_COLOR),
        Sparkle(strip_pixels, SPARKLE_SPEED, SPARKLE_INITIAL_COLOR)
    ),
)
```

The last thing before the main loop are three variables created for various uses in the code. We set `animation_color` to `None`, the `mode` to 0, and `blanked` to `False`.

```python
animation_color = None
mode = 0
blanked = False
```

## Advertising

The first thing we do in the main loop is begin advertising, i.e. sending out a signal that says the NeoPixel Animator is available for a BLE connection.

```python
[...]
    ble.start_advertising(advertisement)  # Start advertising.
```

## Animate the Animations

Regardless of whether we are connected or not, as long as we haven't set blanked to True, we animate the animations.

```python
[...]
    while not was_connected or ble.connected:
        if not blanked:  # If LED-off signal is not being sent...
            animations.animate()  # Run the animations.
```

## Packet Time

Once we are connected, we check to see if any data is available from the Remote Control CPB, and then create the packet object.

```python
[...]
        if ble.connected:  # If BLE is connected...
            was_connected = True
            if uart.in_waiting:  # Check to see if any data is available
                try:
                    packet = Packet.from_stream(uart)  # Create the packet object.
                except ValueError:
                    continue
```

## Color Packets

The color of the NeoPixels on the NeoPixel Animator are constantly changing based on the orientation of the Remote Control, which is constantly sending updated color packets. There are two color modes: color changing and color frozen.

The code first checks to see if the packet received is a color packet. If it is, we check to see if the mode is 0 or 1.

If the mode is 0, we set the animation color to the packet color. Then we save the current packet color as `animation_color`.

This is so we can use it if the mode is 1. What if you find a favorite color and want to keep the animations that color? If the mode is 1, we "freeze" the animation color by setting it to `animation_color`. This only updates when the mode is returned to 0, so as long as the mode is 1, the animations will remain the same color.

```python
[...]
                if isinstance(packet, ColorPacket):
                    if mode == 0:
                        animations.color = packet.color
                        print("Color:", packet.color)
                        animation_color = packet.color
                    elif mode == 1:
                        animations.color = animation_color
                        print("Color:", animation_color)
```

## Button Packets

The NeoPixel Animator is also constantly listening for button packets from the Remote Control. These are used to turn the NeoPixels on and off, change animations, and freeze the animation color.

First we check to see if the packet received is a button packet. If it is, we check to see which button packet it is: `BUTTON_1`, `LEFT` or `RIGHT`.

The Remote Control CPB slide switch is sending the `BUTTON_1` packet. Even though it's not a button you can "press" we're using the "pressed" or "not pressed" state to determine direction: left is the "pressed" state, and right is the "not pressed" state. So we check to see if `BUTTON_1` is "pressed. If it is pressed, and the LEDs are currently on (not blanked), we turn off the LEDs by setting all of them to `BLACK`.

Last, we set `blanked` equal to the "pressed" state of the slide switch - this is so we can track whether the LEDs are currently on or off so we know whether to turn them off or on in the previous two lines of code.

```python
[...]
                elif isinstance(packet, ButtonPacket):
                    if packet.button == ButtonPacket.BUTTON_1:
                        if packet.pressed:
                            print("Remote Control switch is to the left: LEDs off!")
                        else:
                            print("Remote Control switch is to the right: LEDs on!")
                        if packet.pressed and not blanked:
                            animations.fill(color.BLACK)
                        blanked = packet.pressed
```

Next we are looking for the button presses. The two buttons on the Remote Control are sending `LEFT` and `RIGHT` button packets.

If the packet received is a `LEFT` packet, we move to the next animation.

If the packet received is a `RIGHT` packet, we increase the mode by 1. The mode starts as 0 in the beginning of the code. If the mode is 1, we print that the color is frozen. If the mode is greater than 1, we set the mode back to 0, and print that the color is changing. Increasing the mode by 1, and setting it back to 0 when it is greater than 1 allows us to cycle between two different modes.

```python
[...]
                    if packet.pressed:
                        if packet.button == ButtonPacket.LEFT:
                            print("A pressed: animation mode changed.")
                            animations.next()
                        elif packet.button == ButtonPacket.RIGHT:
                            mode += 1
                            if mode == 1:
                                print("B pressed: color frozen!")
                            if mode > 1:
                                mode = 0
                                print("B pressed: color changing!")
```

That's how the NeoPixel Animator code for the Circuit Playground Bluefruit Animation and Color Remote Control works!

# Circuit Playground Bluefruit NeoPixel Animation and Color Remote Control

## Making It Festive

It's that time of year when snow is falling (here, anyway!) and friends are calling. It's the holiday season! So, we've gone to our local craft store and purchased a rather plain wreath with plans to _spruce_ it up!

For this project, you'll need:

- A wreath, or anything you'd like to decorate!
- 2 x Circuit Playground Bluefruits
- 2 x Circuit Playground Enclosures (optional)
- 1 (or 2) NeoPixel strip(s) with alligator clips
- 420mAh lithium ion battery
- 6600mAh lithium ion battery
- A handful of zip ties, including one long enough to fit around the 6600mAh battery
- A strip of double sided tape

![](https://cdn-learn.adafruit.com/assets/assets/000/085/798/medium800/leds_CPB_NeoPIxel_Controller_Parts.jpg?1576200852)

Gather everything together, and let's get started!

## Assembling the Wreath
Place the Circuit Playground Bluefruit boards in their enclosures.

![leds_CPB_NeoPIxel_Controller_CPBs_in_enclosures.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/782/medium640/leds_CPB_NeoPIxel_Controller_CPBs_in_enclosures.jpg?1576189472)

If you're using one NeoPixel strip, connect it as shown in the first image and described in the [Single NeoPixel Strip section of the Assembly page](https://learn.adafruit.com/circuit-playground-bluefruit-neopixel-animation-and-color-remote-control/assembly#single-neopixel-strip-4-2).

If you're using two NeoPixel strips, connect them as shown in the second image and described in the [Two NeoPixel Strips section of the Assembly page](https://learn.adafruit.com/circuit-playground-bluefruit-neopixel-animation-and-color-remote-control/assembly#two-neopixel-strips-4-4).

![leds_CPB_NeoPIxel_Controller_single_strip_clipped_to_CPB.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/783/medium640/leds_CPB_NeoPIxel_Controller_single_strip_clipped_to_CPB.jpg?1576189743)

![leds_CPB_NeoPIxel_Controller_two_strips_clipped_CPB_close.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/787/medium640/leds_CPB_NeoPIxel_Controller_two_strips_clipped_CPB_close.jpg?1576190003)

Lay out the wreath and flatten the branches a bit to make a place for the strips to lie. The way they are designed, the strips will not want to lay flat on their own, so we'll need to zip tie them in place. This also makes the project more permanent. Arrange the strips on the wreath.

Starting at the top, begin to place zip ties along the strips, holding the strips flat as you tighten the zip tie. Line the zip ties up so they sit between NeoPixels - we don't want to lose any light if we can avoid it!

Continue to zip tie the strips in place until you've secured them all the way around the wreath.

Slip a zip tie through the slots on the back of the Circuit Playground Enclosure of the NeoPixel Animator Circuit Playground Bluefruit and secure it to the wreath. You may need to arrange the alligator clips around the strips to settle the NeoPixel Animator CPB as flat as possible.

![leds_CPB_NeoPIxel_Controller_strips_arranged_on_wreath.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/789/medium640/leds_CPB_NeoPIxel_Controller_strips_arranged_on_wreath.jpg?1576190064)

![leds_CPB_NeoPIxel_Controller_strips_zip_tied_started.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/793/medium640/leds_CPB_NeoPIxel_Controller_strips_zip_tied_started.jpg?1576190389)

![leds_CPB_NeoPIxel_Controller_strips_zip_tied.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/797/medium640/leds_CPB_NeoPIxel_Controller_strips_zip_tied.jpg?1576200674)

![leds_CPB_NeoPIxel_Controller_zip_tie_on_CPB.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/799/medium640/leds_CPB_NeoPIxel_Controller_zip_tie_on_CPB.jpg?1576201025)

![leds_CPB_NeoPIxel_Controller_CPB_zip_tied.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/801/medium640/leds_CPB_NeoPIxel_Controller_CPB_zip_tied.jpg?1576201163)

![leds_CPB_NeoPIxel_Controller_strips_zip_tied_complete.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/827/medium640/leds_CPB_NeoPIxel_Controller_strips_zip_tied_complete.jpg?1576250924)

Now it's time to attach the 6600mAh battery to the wreath. Make sure the zip tie you're using will fit around the battery. If it doesn't, you can connect two zip ties together to make one longer one.

Flip the wreath over and slip a zip tie through the front behind the NeoPixel Animator Circuit Playground Bluefruit.

Place the battery so it's centered behind the foliage, and zip tie it down. Tuck the wire around to the front where it will be plugged into the NeoPixel Animator CPB.

The battery may move around some as it's only attached at one point, but there were no issues on our build. As long as the zip tie is tight, it's not going anywhere.

![leds_CPB_NeoPIxel_Controller_Battery_zip_tie.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/828/medium640/leds_CPB_NeoPIxel_Controller_Battery_zip_tie.jpg?1576251103)

![leds_CPB_NeoPIxel_Controller_Placing_battery_for_zip_tie.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/829/medium640/leds_CPB_NeoPIxel_Controller_Placing_battery_for_zip_tie.jpg?1576251245)

![leds_CPB_NeoPIxel_Controller_large_battery_zip_tied.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/830/medium640/leds_CPB_NeoPIxel_Controller_large_battery_zip_tied.jpg?1576251294)

## Assembling the Remote Control
Use the double-sided tape to attach the 420mAh to the back of the Remote Control.

Stick the tape to the battery, and then stick the battery on the back of the Circuit Playground Enclosure on the Remote Control Circuit Playground Bluefruit.

![leds_CPB_NeoPIxel_Controller_tape_on_battery.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/831/medium640/leds_CPB_NeoPIxel_Controller_tape_on_battery.jpg?1576251894)

![leds_CPB_NeoPIxel_Controller_battery_taped_to_enclosure.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/832/medium640/leds_CPB_NeoPIxel_Controller_battery_taped_to_enclosure.jpg?1576251990)

Plug in both batteries, and you're ready to go!

As a final touch, you can arrange the branches of the wreath to cover the LED strips for a more subtle look. Or leave them uncovered, whatever you like best!

![leds_CPB_NeoPIxel_Controller_Final_Assembly.jpg](https://cdn-learn.adafruit.com/assets/assets/000/085/833/medium640/leds_CPB_NeoPIxel_Controller_Final_Assembly.jpg?1576252116)

![](https://cdn-learn.adafruit.com/assets/assets/000/085/834/medium800/leds_CPB_NeoPIxel_Controller_Wreath_and_Controller_Lit_Up.jpg?1576252463)


## Featured 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...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4333)
[Related Guides to the Product](https://learn.adafruit.com/products/4333/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)
### Adafruit NeoPixel LED Strip w/ Alligator Clips - 60 LED/m

[Adafruit NeoPixel LED Strip w/ Alligator Clips - 60 LED/m](https://www.adafruit.com/product/3811)
Adding glowy color to your projects has never been easier: no more soldering or stripping wires, clip 'em on and glow! This **Adafruit NeoPixel LED Strip with Alligator Clips** has **30 total LEDs** in a **"60 LED per meter" spacing** , and...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3811)
[Related Guides to the Product](https://learn.adafruit.com/products/3811/guides)
### Adafruit NeoPixel LED Strip w/ Alligator Clips - 30 LEDs/meter

[Adafruit NeoPixel LED Strip w/ Alligator Clips - 30 LEDs/meter](https://www.adafruit.com/product/3812)
Adding glowy color to your projects has never been easier: no more soldering or stripping wires, clip 'em on and glow! This **Adafruit NeoPixel LED Strip with Alligator Clips** has **30 total LEDs in a "30 LED per meter" spacing** , and is 1 meter long,...

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

[Lithium Ion Battery Pack - 3.7V 6600mAh](https://www.adafruit.com/product/353)
Need a massive battery for your project? This lithium-ion pack is made of 3 balanced 2200mAh cells for a total of 6600mA capacity! The cells are connected in parallel and spot-welded to a protection circuit that provides over-voltage, under-voltage, and over-current protection.

Each cell...

Out of Stock
[Buy Now](https://www.adafruit.com/product/353)
[Related Guides to the Product](https://learn.adafruit.com/products/353/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)
### Adafruit Circuit Playground Bluefruit Express Starter Kit

[Adafruit Circuit Playground Bluefruit Express Starter Kit](https://www.adafruit.com/product/4504)
If you missed out on ADABOX 014, its not too late for you to pick up the parts necessary to build many of the projects! This kit pack doesn't come with tissue paper or the nifty extras, but it does have all the electronic goodies you need  
  
This project pack features...

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

## Related Guides

- [Adafruit Circuit Playground Bluefruit](https://learn.adafruit.com/adafruit-circuit-playground-bluefruit.md)
- [Magical Cardboard Craft Obsidian Sword](https://learn.adafruit.com/cardboard-obsidian-sword.md)
- [Circuit Playground Bluefruit Automatic Bike Brake Light](https://learn.adafruit.com/circuit-playground-bluefruit-brake-light.md)
- [Circuit Playground Bluefruit Quick Draw Duo](https://learn.adafruit.com/circuit-playground-bluefruit-quick-draw-duo.md)
- [LED Reactive Light-Up Hockey Puck in MakeCode](https://learn.adafruit.com/led-hockey-puck.md)
- [Drama Piñata](https://learn.adafruit.com/customizable-reusable-pinata.md)
- [CircuitPython BLE Libraries on Any Computer](https://learn.adafruit.com/circuitpython-ble-libraries-on-any-computer.md)
- [CircuitPython Sin Complicaciones para la Circuit Playground Express y la Bluefruit](https://learn.adafruit.com/circuitpython-sin-complicaciones-para-la-circuit-playground-express.md)
- [Adafruit Circuit Playground Tri-Color E-Ink Gizmo](https://learn.adafruit.com/adafruit-circuit-playground-tri-color-e-ink-gizmo.md)
- [Scratch 3 Walkthrough and Demo](https://learn.adafruit.com/guide-to-scratch-3.md)
- [LED Emerald with Circuit Playground Bluefruit](https://learn.adafruit.com/led-emerald-with-circuit-playground.md)
- [PyLeap device enabled - In Rainbows](https://learn.adafruit.com/pyleap-device-enabled-in-rainbows.md)
- [PyLeap NeoPixel Sound Meter for Circuit Playground Bluefruit](https://learn.adafruit.com/pyleap-neopixel-sound-meter.md)
- [PyLeap Tone Piano for Circuit Playground Bluefruit](https://learn.adafruit.com/pyleap-tone-piano-for-cpb.md)
- [Simon Game for PyRuler and CircuitPython](https://learn.adafruit.com/simon-game-with-pyruler-and-circuitpython.md)
- [Programmable Wireless BLE Gesture Mouse](https://learn.adafruit.com/ble-wireless-gesture-mouse.md)
