# Circuit Playground Christmas Tree

## Overview

https://www.youtube.com/watch?v=9Ey22pLd3n8

In this project we'll use a Circuit Playground Express to light up a 3D print Christmas tree. The 10x on-board NeoPixels are perfect for lighting up all sorts of decorations and props. Our custom designed geometric Christmas tree is hollow with a thin walled shell. This allows internal light to nicely diffuse the shape. It's also designed to be 3D printed without any support material.

![3d_printing_scene-cpx.jpg](https://cdn-learn.adafruit.com/assets/assets/000/067/755/medium640/3d_printing_scene-cpx.jpg?1545178330)

## Circuit Python Code

Learn how to use Adafruit's Circuit Python to write code and light up the NeoPixel LEDs using colors and animations. Just download the latest UF2 for your CPX and get the latest library bundle to get started. Our demo code will get you up and running quick and easy!

![3d_printing_cpython-programming.jpg](https://cdn-learn.adafruit.com/assets/assets/000/067/766/medium640/3d_printing_cpython-programming.jpg?1545185062)

A special 3D printed mount secures the Adafruit Circuit Playground Express and snap fits under the Christmas Tree. For best lighting effects, use translucent PLA filament to nicely diffuse NeoPixel LEDs.

![3d_printing_cpx-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/067/756/medium640/3d_printing_cpx-mount.jpg?1545179467)

## Prerequisite Guides

There's resources in these guides that go beyond what's covered in this tutorial. The introduction guide is all about setting up your Circuit Playground Express board. The Circuit Python introduction guide walks you through all of the pinouts, sensors and everything you need to know.

- [Introducing Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express)
- [Welcome to Circuit Python](https://learn.adafruit.com/welcome-to-circuitpython)

![](https://cdn-learn.adafruit.com/assets/assets/000/067/758/medium800/3d_printing_hero-tree.jpg?1545179613)

## USB Power

The Circuit Playground Express can stay connected via USB power from either a wall adapter or computer's hub. This allows the Christmas Tree to stay lit as long as you want (nightlight mode anyone?). The Christmas tree has a cutaway to accommodate for a USB cable. Lipo battery is optional and can be tucked in between the Circuit Playground Express and 3D printed mount.

![](https://cdn-learn.adafruit.com/assets/assets/000/067/763/medium800thumb/3d_printing_scene.jpg?1545183835)

# Circuit Playground Christmas Tree

## 3D Printing

https://www.youtube.com/watch?v=-kVWIvNkYwU

## Snap-On CPX Mount

This 3D printed mount is designed specifically secure the Circuit Playground Express (and Classic) without any hardware screws. Tabs on the sides grasp the edges of the PCB and hold it in place. Built-in standoffs elevate the PCB allowing room for a 500mAh lipo battery. The symmetrical design allows any orientation and provides cut aways for JST and USB connectors.&nbsp;

![3d_printing_cpx-mount-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/067/776/medium640/3d_printing_cpx-mount-parts.jpg?1545249176)

## 3D Modeling CAD

The geometric tree was designed in Autodesk Fusion 360. The source file is available to download and features sketches and parametric timeline so it's free to tweak and modify.

![3d_printing_cad.gif](https://cdn-learn.adafruit.com/assets/assets/000/067/762/medium640thumb/3d_printing_cad.jpg?1545182356)

## 3D Printed Parts

The tree is printed in a translucent filament to better diffuse the LEDs. A special dual color version was designed for dual extrusion setups. The starfruit tree topper requires support material, optionally split in half&nbsp; print in two pieces and glue together.&nbsp;

![3d_printing_3d-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/067/759/medium640/3d_printing_3d-parts.jpg?1545179763)

[Download CAD Files](https://www.thingiverse.com/thing:3296375)
## Dual Extrusion

Different colors can be used to create masking effects that reveal light using translucent colors. The black tree is a mix of Fillamentum's Verito Galaxy PLA and Translucent PLA for the rings – This creates a lighting effects that illuminates the rings around the tree.&nbsp;

![3d_printing_trees.jpg](https://cdn-learn.adafruit.com/assets/assets/000/067/760/medium640/3d_printing_trees.jpg?1545180997)

## Delicious Filaments

For high quality prints we suggest good quality filaments from awesome manufacturers. Here's a list of the various filaments we used in this project.

- [Fillamentum Vertigo Galaxy PLA](https://fillamentum.com/products/pla-extrafill-vertigo-galaxy)
- [NinjaFlex Snow White 85A TPU](https://www.adafruit.com/product/1691)
- [UltiMachine Blue Translucent PLA](https://ultimachine.com/collections/pla/products/pla-blue-translucent-3d-printer-filament)
- [Proto-Pasta Cupids Crush Metallic Pink PLA](https://www.proto-pasta.com/products/cupids-crush-metallic-pink-htpla)
- [Polyalchemy Emerald City Elixir PLA](https://www.polyalchemy.com/collections/elixir-pla/products/elixir-pla-emerald-city-1-kg)
- [Fillamentum PLA ExtraFill Gold Happens](https://fillamentum.com/products/fillamentum-pla-extrafill-gold-happens)

## Slice Settings

Use these settings as reference. Values listed were used in [Ultimaker's CURA 3.X](https://ultimaker.com/en/products/ultimaker-cura-software) slicing software.

- 0.2mm Layer Height / 0.4mm nozzle
- 0.38mm Line Width (inner & outer widths)
- 60mm/s printing speed
- 20% infill

![3d_printing_cura-slicer.jpg](https://cdn-learn.adafruit.com/assets/assets/000/067/765/medium640/3d_printing_cura-slicer.jpg?1545184993)

## Multi-Purpose CPX Mount

This mount makes for a quick 3D print and provide decent support for making a simple and portable project. To remove the Circuit Playground from the mount, use fingers to pull apart tabs and push PCB outwards from underneath.

![3d_printing_cpx-mount-adabot.jpg](https://cdn-learn.adafruit.com/assets/assets/000/067/780/medium640/3d_printing_cpx-mount-adabot.jpg?1545249449)

## Design Source Files

The tree and CPX mount was designed in Fusion 360.&nbsp;This can be downloaded in different formats like STEP, SAT and more. Electronic components like the board, displays, connectors and more can be downloaded from our&nbsp;[Fusion 360 CAD parts github repo](https://github.com/adafruit/Adafruit_CAD_Parts).

[Download Adafruit CAD Parts](https://github.com/adafruit/Adafruit_CAD_Parts)
# Circuit Playground Christmas Tree

## Software

![](https://cdn-learn.adafruit.com/assets/assets/000/067/764/medium800/3d_printing_cpython-banner.jpg?1545184210)

## Setup Adafruit Circuit Playground Express for CircuitPython

We'll need to get our board setup so we can run CircuitPython code. First thing we'll need to do is connect the board to your computer with a microUSB cable. Then double-click on the reset button to put it&nbsp;in "UF2" boot-loader mode. The NeoPixels will turn green. The board will then show up as a USB&nbsp;storage device on your computer named "CPLAYBOOT".&nbsp;

Follow the guide below to setup&nbsp;the firmware, once complete, come back here and proceed.

[CircuitPython for Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express?view=all#what-is-circuitpython)
## Editing Code

You'll want to use the Mu python editor to modify the code.&nbsp;Mu is a simple code editor that works with the Adafruit CircuitPython boards. It's written in Python and works on Windows, MacOS, Linux and Raspberry Pi. The serial console is built right in so you get immediate feedback from your board's serial output! See the guide below to for download and setup instructions.

[Install Mu Editor Guide](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor)
## 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 **CircuitPlayground\_Christmas\_Tree/** 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/CircuitPlayground_Christmas_Tree.png )

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


## Related Guides

- [Sound Activated Shark Mask](https://learn.adafruit.com/sound-activated-shark-mask.md)
- [Unicorn Christmas Stocking with Rainbow Lights & Sound](https://learn.adafruit.com/unicorn-christmas-stocking-with-lights-sound.md)
- [3D Printed Valentine with Bare Conductive Electric Paint](https://learn.adafruit.com/3d-printed-valentine-with-bare-conductive-electric-paint.md)
- [Cast a 3d Printed Necklace in Metal](https://learn.adafruit.com/cast-a-3d-printed-necklace-in-metal.md)
- [Qu'est-ce que MakeCode?](https://learn.adafruit.com/makecode-fr.md)
- [3D Printing on PRINTinZ: Flexible Build Plate](https://learn.adafruit.com/3d-printing-on-ninjaplate-flexible-build-plate.md)
- [Circuit Playground or Hallowing Jack-o'-Lantern](https://learn.adafruit.com/circuit-playground-jack-o-lantern.md)
- [Fruit Jam Case](https://learn.adafruit.com/fruit-jam-case.md)
- [Mini GIF Players](https://learn.adafruit.com/mini-gif-players.md)
- [Labo Piano Light FX](https://learn.adafruit.com/labo-piano-light-fx.md)
- [Car Qi Charger](https://learn.adafruit.com/tesla-qi-charger.md)
- [Mini UNTZtrument: 3D Printed MIDI Controller](https://learn.adafruit.com/mini-untztrument-3d-printed-midi-controller.md)
- [Circuit Playground Beep Beep](https://learn.adafruit.com/circuit-playground-beep-beep.md)
- [Talking D20 with RP2040 PropMaker Feather](https://learn.adafruit.com/talking-d20-rp2040.md)
- [Robotic AI Bear using ChatGPT](https://learn.adafruit.com/robotic-ai-bear-using-chatgpt.md)
