# Mason Jar Snow Globe

## Shiny Snow Globe!

https://youtu.be/sYFIDvd1HEE

It's the holidays and you need a colorful snowglobe to cheer up. No worries, MakeCode and Adafruit Circuit Playground Express are here to cheer you up.

In this project, we will use the 10 NeoPixels of the Circuit Playground Express to light up a DIY snowglobe. For the body of the globe we'll use an every day mason jar, you can find these in your hardware or grocery store. 

Sounds simple? Let's do it.

## Materials

Pick a jar and an **extra lid** to build the snow globe. The extra lid should be large enough to hold the Circuit Playground Express. You will also need a tool to cut into the lid and a glue gun.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/243/medium800/makecode_IMG_7347.jpg?1513122887)

## Building the base

Place the Circuit Playground Express inside the lid and mark both sides for the JST and USB connectors. Cut out openings and make sure you can squeeze the cables in. The lid will sit **under** the jar which will keep the CPX nicely away from the water.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/244/medium800/makecode_IMG_7348.jpg?1513123125)

## Connect the globe

Build your favorite snow globe using one of the gazillion tutorial online. I just used water, gliceryn and glitter. When you're done, use glue to secure the lib to the bottom.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/245/medium800/makecode_IMG_7350.jpg?1513123184)

## Unplugging...

Once the glue is solidified, you can carefully "unplug" it from the lid. It is now molded/casted to the lid and easily sits on it. Since water and electronics don't work well together, it's easier to keep the Circuit Playground Express while working on the liquid part of the globe...

## Pro tip: Automatic stirring

Dip a Playmobil underwater motor in your globe to keep these glitter particles moving!


https://youtu.be/dws_x2oKeq0

# Mason Jar Snow Globe

## Light show

An easy way to get started is to run a bunch of animation in a forever loop. Go to https://makecode.adafruit.com and drag various animations from the **LIGHT** drawer. Download the code to your board and voila!

https://makecode.com/_MEcd9eJuW5dd

# Mason Jar Snow Globe

## Clap clap

We would like to be able to turn on and off the light easily. The board is tucked under the globe so buttons or gestures are not really doable... which leaves us with the microphone!!!

Using the **on loud sound**, we switch the animation on and off. We use a variable **on** to keep track of the animation state (true = on, false = off).

When the variable **on** turns false, we cancel the current animation and clear the LEDs. The **forever** loop keeps running in the background but only animations when **on** is true.

https://makecode.com/_2kb0b4bpFg8K


## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Chinese Dragon Puppet with Motion-Reactive Flame Effect](https://learn.adafruit.com/chinese-dragon-puppet-with-motion-reactive-flame-effect.md)
- [Make It Glow: How to Solder NeoPixels, A Beginner's Guide](https://learn.adafruit.com/make-it-glow-how-to-solder-neopixels-a-beginners-guide.md)
- [Circuit Playground Express Perk-up Ears](https://learn.adafruit.com/perk-up-ears.md)
- [Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express](https://learn.adafruit.com/controlling-a-classic-nintendo-r-o-b-robot-using-circuit-playground-express.md)
- [Glowing Interactive Crystal Staff ](https://learn.adafruit.com/glowing-interactive-crystal-staff.md)
- [Circuit Playground Express Sugar Glider](https://learn.adafruit.com/cpx-sugar-glider.md)
- [LEGO Head Lamp with Audio](https://learn.adafruit.com/lego-head-lamp-with-audio.md)
- [Spy Theme Playback Device](https://learn.adafruit.com/spy-theme-playback-device.md)
- [Flapping Halloween Vampire Bat](https://learn.adafruit.com/flapping-halloween-vampire-bat.md)
- [Crickit Collapsible House with MakeCode](https://learn.adafruit.com/collapsible-house.md)
- [Infrared Hand Gesture Robot Control Glove](https://learn.adafruit.com/cpx-ir-infrared-hand-gesture-robot-control-glove.md)
- [Glowing Slime Lunchbox](https://learn.adafruit.com/glowing-slime-lunchbox.md)
- [Custom Controllers for MakeCode Arcade](https://learn.adafruit.com/custom-controllers-for-makecode-arcade.md)
- [Magical Cardboard Craft Obsidian Sword](https://learn.adafruit.com/cardboard-obsidian-sword.md)
- [CPX Glowing Disembodied Hand](https://learn.adafruit.com/cpx-glowing-disembodied-hand.md)
