CircuitPython Snow Globe

Similar documents
Adabot Operation Game

UFO Flying Saucer with Circuit Playground Express

Wind Blowing Emoji Prop

Crickit Carnival Bumper Bot

Slider Crank Mechanism -- from Cardboard and Craft Sticks

Pushrod Garage. Created by John Park. Last updated on :07:30 PM UTC

Infinity Mirror Valentine's Candy Box

PyPortal NeoPixel Color Picker Created by Kattni Rembor. Last updated on :42:41 PM UTC

CPX Mystery Dreidel. Created by Kathy Ceceri. Last updated on :51:40 PM UTC

Circuit Playground Express Laser Tag

Milk Jug Glow Skull. Created by John Park. Last updated on :28:36 PM UTC

The Scream: Interactive Screaming Painting

Stumble-Bot. Created by Dano Wall. Last updated on :04:06 AM UTC

Crickit Powered Holiday Diorama

Android GBoard Morse Code Control with Circuit Playground Express

Ping Pong Ball Launcher

Glowing Smokey Skull. Created by Ruiz Brothers. Last updated on :03:40 PM UTC

Crickit Dancing Marionette Kit Created by Dano Wall. Last updated on :03:11 PM UTC

Con Badge with Circuit Playground Express

Clockwork Goggles. Created by John Park. Last updated on :03:10 PM UTC

Bunny Ears with MakeCode

Secret Hollow Book Intrusion Detector

NeoPixel Ring Bangle Bracelet

Hammer Time Mini Golf Hazard with Crickit

Crawling Baby Sea Turtle Robot

Sword & Wand Prop Effects with Circuit Playground

NeoPixie Dust Bag with Circuit Playground Express

Neon LED Signs. Created by John Park. Last updated on :11:09 PM UTC

Steven Universe Cosplay Shirt & Gem Created by Erin St Blaine. Last updated on :54:25 PM UTC

Adafruit LED Sequins. Created by Becky Stern. Last updated on :02:00 AM UTC

Crawling Animatronic Hand

NeoPixel Manicure. Created by Sophy Wong. Last updated on :50:38 PM UTC

NeoPixel Fairy Crown. Created by Erin St Blaine. Last updated on :22:47 AM UTC

Circuit Playground Express Head-Tilt Ears

Paper Airplane Launcher

Snake Charmer Box. Created by Dano Wall. Last updated on :07:25 PM UTC

Reindeer Mask with Animated Eyes

Webcam Cover-Up Lego brick with Adabot Mini Fig

BLE Light Switch with Feather nrf52840 and Crickit

3D Printed Camera LED Ring

Trash Panda. Created by Dano Wall. Last updated on :30:46 AM UTC

Portable Apple Watch Charger

NeoPixel Basketball Hoop

Mini Golf Course with Circuit Playground and Crickit

LED Breath Stats Mask

Crickit Powered Mini Chair Swing Ride!

NeoPixel Bike Light. Created by Ruiz Brothers. Last updated on :43:46 PM UTC

Solar Boost Bag. Created by Becky Stern. Last updated on :44:55 PM UTC

Audio Prank Gift Box. Created by Becky Stern. Last updated on :46:15 PM UTC

Circuit Playground Yoyo

3D Printed LED Buckle

Simple LED Unicorn Horn

Feather Weather Lamp. Created by Ruiz Brothers. Last updated on :54:26 PM UTC

HalloWing Jump Scare Trap

NeoMatrix 8x8 Word Clock

LED Eyes. Created by Ruiz Brothers. Last updated on :50:55 AM UTC

Adafruit GPIO Expander Bonnet for Raspberry Pi Created by Kattni Rembor. Last updated on :12:47 PM UTC

Making Adabot: Part 1

Zelda Thunder Helm. Created by Ruiz Brothers. Last updated on :46:52 PM UTC

3D Printed Google AIY Voice Kit

Data Logging with Feather and CircuitPython

Unicorn Hat with Moving Ears

3D Printed Case for Adafruit Feather

Celebration Spectacles

Desktop Fume Extractor

No-Sew LED Wristband. Created by Kathy Ceceri. Last updated on :23:40 PM UTC

GPS Logging Dog Harness

Bike Wheel POV Display

Bluetooth Controlled NeoPixel Headphones

Circuit Playground Kaleidoscope

Naughty or Nice Machine

FLORA TV-B-Gone. Created by Becky Stern. Last updated on :32:57 PM UTC

Easy Sparkle Pocket T-Shirt

Overwatch Prop Gun: Lucio's Blaster Pt. 3

Mystical LED Halloween Hood

ISS Pin. Created by Leslie Birch. Last updated on :27:30 PM UTC

Interior Purse Light. Created by Becky Stern. Last updated on :41:08 PM UTC

Circuit Playground Combadge

Solder Dispenser Adabot Head

Tent Lantern. Created by Timothy Reese. Last updated on :17:25 AM UTC

Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout

Trellis 3D Printed Enclosure

Light-Up Angler Fish Embroidery

Adafruit APDS9960 breakout

7" Portable HDMI Monitor

MiniPOV4 - DIY Full-Color Persistence of Vision & Light-Painting Kit

Phone-Activated Talking Dog Collar

Adafruit Capacitive Touch Sensor Breakouts

Circuit Playground Digital Input

Adafruit DRV2605 Haptic Controller Breakout

DIY Circuit Playground Shields

Jewel Hair Stick. Created by Leslie Birch. Last updated on :47:17 PM UTC

PyPortal View Master Created by Ruiz Brothers. Last updated on :51:28 AM UTC

Introducing Adafruit Trellis

Adafruit PowerBoost 500 Shield

FLORA Pixel Brooch. Created by Becky Stern. Last updated on :19:07 PM EST

Magical Mistletoe. Created by Leslie Birch. Last updated on :45:29 PM UTC

3D Printed LED Knuckle Jewelry

Adafruit MMA8451 Accelerometer Breakout

Getting Started with FLORA

Transcription:

CircuitPython Snow Globe Created by John Park Last updated on 2018-08-22 04:04:24 PM UTC

Guide Contents Guide Contents Overview Materials and Parts Code with CircuitPython Get Ready! Download the Snow Globe Python Code Snowy Code! Using the Circuit Playground Express library A Tour of the Code Fading Pixels Playing a Song Playing one note Playing many notes Main Loop! Make the Snow Globe Globe Preparation Electronics Battery Power Add the Figurine Attach the Figure to the Plug Take the Plunge Screw on the Lid Use the Snow Globe 2 3 3 5 5 5 8 8 8 9 10 11 11 13 15 15 17 17 22 23 25 28 29 Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 2 of 32

Overview You can use your Circuit Playground Express (CPX) to build a fun, interactive, and beautiful holiday snow globe! Using CircuitPython, you can code the CPX to read its built-in acceleromter and detect when the snow globe is being shaken, and then play back a melody and festive light show!! Materials and Parts Besides the electronics listed below, you'll also need: snow globe kit (available at hobby stores) glitter distilled water glycerin double stick foam tape E6000 glue or equivalent a figurine, such as a LEGO minifigure or 3D printer to make your own Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 3 of 32

1 x Circuit Playground Express with CircuitPython ADD TO CART 1 x 3x AAA Battery Holder with On/Off Switch and 2-pin JST 1 x Alkaline AAA batteries 3 pack ADD TO CART ADD TO CART Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 4 of 32

Code with CircuitPython You'll code your snow globe using CircuitPython. You'll be able to use the built-in accelerometer to detect when the snow globe is shaken, and then play a light show on the NeoPixels and play simple songs with the built-in speaker. Get Ready! 1. First, make sure you're familiar with the basics of using CircuitPython on the Circuit Playground Express. Follow this guide (https://adafru.it/chm) to familiarize yourself. 2. Then, install CircuitPython on your board by following these instructions (https://adafru.it/afi). 3. The last thing to do to prepare is to install the library bundle onto your board as shown here (https://adafru.it/c9m). The libraries give us what we need to code easily with high level commands! Download the Snow Globe Python Code Copy the code below, and paste it into a new text document in your text editor, or in the Mu code editor for CircuitPython. """Snow Globe for Adafruit Circuit Playground express with CircuitPython """ import math import time from adafruit_circuitplayground.express import cpx ROLL_THRESHOLD = 30 # Total acceleration cpx.pixels.brightness = 0.1 # set brightness value WHITE = (65, 65, 65) RED = (220, 0, 0) GREEN = (0, 220, 0) BLUE = (0, 0, 220) SKYBLUE = (0, 20, 200) BLACK = (0, 0, 0) # Initialize the global states new_roll = False rolling = False # pick from colors defined above, e.g., RED, GREEN, BLUE, WHITE, etc. def fade_pixels(fade_color): # fade up for j in range(25): pixel_brightness = (j * 0.01) cpx.pixels.brightness = pixel_brightness for i in range(10): cpx.pixels[i] = fade_color # fade down for k in range(25): pixel_brightness = (0.25 - (k * 0.01)) cpx.pixels.brightness = pixel_brightness for i in range(10): cpx.pixels[i] = fade_color # fade in the pixels Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 5 of 32

# fade in the pixels fade_pixels(green) # pylint: disable=too-many-locals def play_song(song_number): # 1: Jingle bells # 2: Let It Snow # set up time signature whole_note = 1.5 # adjust this to change tempo of everything # these notes are fractions of the whole note half_note = whole_note / 2 quarter_note = whole_note / 4 dotted_quarter_note = quarter_note * 1.5 eighth_note = whole_note / 8 # pylint: disable=unused-variable # set up note values A3 = 220 Bb3 = 233 B3 = 247 C4 = 262 Db4 = 277 D4 = 294 Eb4 = 311 E4 = 330 F4 = 349 Gb4 = 370 G4 = 392 Ab4 = 415 A4 = 440 Bb4 = 466 B4 = 494 if song_number == 1: # jingle bells jingle_bells_song = [ [E4, quarter_note], [E4, quarter_note], [E4, half_note], [E4, quarter_note], [E4, quarter_note], [E4, half_note], [E4, quarter_note], [G4, quarter_note], [C4, dotted_quarter_note], [D4, eighth_note], [E4, whole_note], ] # pylint: disable=consider-using-enumerate for n in range(len(jingle_bells_song)): cpx.start_tone(jingle_bells_song[n][0]) time.sleep(jingle_bells_song[n][1]) cpx.stop_tone() if song_number == 2: # Let It Snow let_it_snow_song = [ [B4, dotted_quarter_note], Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 6 of 32

] [A4, eighth_note], [G4, quarter_note], [G4, dotted_quarter_note], [F4, eighth_note], [E4, quarter_note], [E4, dotted_quarter_note], [D4, eighth_note], [C4, whole_note], for n in range(len(let_it_snow_song)): cpx.start_tone(let_it_snow_song[n][0]) time.sleep(let_it_snow_song[n][1]) cpx.stop_tone() play_song(1) # play music on start # Loop forever while True: # check for shaking # Compute total acceleration x_total = 0 y_total = 0 z_total = 0 for count in range(10): x, y, z = cpx.acceleration x_total = x_total + x y_total = y_total + y z_total = z_total + z time.sleep(0.001) x_total = x_total / 10 y_total = y_total / 10 z_total = z_total / 10 total_accel = math.sqrt(x_total * x_total + y_total * y_total + z_total * z_total) # Check for rolling if total_accel > ROLL_THRESHOLD: roll_start_time = time.monotonic() new_roll = True rolling = True print('shaken') # Rolling momentum # Keep rolling for a period of time even after shaking stops if new_roll: if time.monotonic() - roll_start_time > 2: # seconds to run rolling = False # Light show if rolling: fade_pixels(skyblue) fade_pixels(white) cpx.pixels.brightness = 0.8 cpx.pixels.fill(white) elif new_roll: new_roll = False Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 7 of 32

new_roll = False # play a song! play_song(2) # return to resting color fade_pixels(green) cpx.pixels.brightness = 0.05 cpx.pixels.fill(green) Now, save the code onto your Circuit Playground Express as main.py The board will restart once the code has been saved. You'll see the pixels fade up green, and then a song plays. Now, you can shake the board to start the snowfall light sequence, followed by a second song. Finally, it will fade back to green, awaiting the next time it is shaken. Here's how the code works! Snowy Code! There are three basic things we need for our code to do: 1. Recognize when it's being shaken 2. Play music 3. Light lights Using the Circuit Playground Express library In CircuitPython on the Circuit Playground Express, we can do most of these things with high level commands, such as: cpx.pixels.fill(255, 0, 0) to make all of the NeoPixels turn red, or: cpx.start_tone(440) to play an A4 music note. (These commands are made possible by the use of the Circuit Playground Express library which is part of the library bundle you installed.) With the library available on the board, you can then import it into your code with this line: from adafruit_circuitplayground.express import cpx Now, you can use a number of commands that simplify and make consistent the ways you work with the board. Most functions, such as reading the buttons and sensors, to lighting NeoPixels, and playing tones and.wav files have a cpx command available. A Tour of the Code Let's have a look at the code in small chunks before we save the entire program to the board. First, we'll import the libraries to give us access to simpler, higher level commands that we'll need. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 8 of 32

# Snow Globe # Circuit Playground Express from adafruit_circuitplayground.express import cpx import math import time Next, we'll set up a variable called ROLL_THRESHOLD that determines how hard we'll need to shake the snow globe to activate it. We'll also set the total brightness of the NeoPixels, and create color names to control the red, green, and blue values of the LEDs without needing to write in the numerical values each time. ROLL_THRESHOLD = 30 # Total acceleration cpx.pixels.brightness = 0.1 # set brightness value WHITE = (65, 65, 65) RED = (220, 0, 0) GREEN = (0, 220, 0) BLUE = (0, 0, 220) SKYBLUE = (0, 20, 200) BLACK = (0, 0, 0) Fading Pixels In order to make our code efficient, we'll create a function named fade_pixels that controls the fade up and fade down of NeoPixels. We can call this function, along with one of our pre-defined color names, any time we need to animate the lights later on. The contents of this function are two loops, one for fade up and a second for fade down. Let's look at the fade up loop (they both work essentially the same way). The line for j in range(25): is a loop that iterates the code below it that is indented in a level 25 times. Each time, it increments the value of j by one, so j starts at 0 and ends at 24. The code that is iterated is an increase of the pixel_brightness variable: pixel_brightness = (j * 0.01) So, this starts out as 0 and steps through to a value of 0.24 This number is is then applied to the NeoPixels overall in the next line: cpx.pixels.brightness = pixel_brightness Then, each of the ten NeoPixel is set to the specified fade_color with the next loop for i in range(10): which iterates over the line cpx.pixels[i] = fade_color Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 9 of 32

def fade_pixels(fade_color): # pick from colors defined above, e.g., RED, GREEN, BLUE, WHITE, etc. # fade up for j in range(25): pixel_brightness = (j * 0.01) cpx.pixels.brightness = pixel_brightness for i in range(10): cpx.pixels[i] = fade_color # fade down for k in range(25): pixel_brightness = (0.25 - (k * 0.01)) cpx.pixels.brightness = pixel_brightness for i in range(10): cpx.pixels[i] = fade_color Playing a Song The next function definition is play_song() which is used to play one of two songs coded within, Jingle Bells or Let It Snow. You could write other songs and add them! First, we create a variable called whole_note to define the length of a whole note, in this case 1.5 seconds. You can adjust that to increase or decrease the tempo. All other note lengths are derived from this one variable, e.g. half_note is a whole_note * 0.5 Similarly, we create a series of variables to define the pitches different notes, starting from A3 up to B4. This way, we can call the command cpx.start_tone() with a note name instead of a frequency value. This makes it much easier to transcribe from standard music notation! Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 10 of 32

def play_song(song_number): # 1: Jingle bells # 2: Let It Snow # set up time signature whole_note = 1.5 # adjust this to change tempo of everything # these notes are fractions of the whole note half_note = whole_note / 2 quarter_note = whole_note / 4 dotted_quarter_note = quarter_note * 1.5 eighth_note = whole_note / 8 # set up note values A3 = 220 Bb3 = 233 B3 = 247 C4 = 262 Db4 = 277 D4 = 294 Eb4 = 311 E4 = 330 F4 = 349 Gb4 = 370 G4 = 392 Ab4 = 415 A4 = 440 Bb4 = 466 B4 = 494 Playing one note To play one note, say a C, for a quarter note duration, we'll start the tone, sleep for a quarter note, and stop the tone. It will look like this: cpx.start_tone(c4) time.sleep(qn) cpx.stop_tone() Playing many notes There are a couple of ways to transcribe a song using this method. The first way is very clear, but uses many lines of code: Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 11 of 32

if song_number == 1: # jingle bells for i in range(2): # repeat twice # jingle bells... cpx.stop_tone() cpx.start_tone(e4) time.sleep(qn) cpx.stop_tone() cpx.start_tone(e4) time.sleep(qn) cpx.stop_tone() cpx.start_tone(e4) time.sleep(hn) cpx.stop_tone() # jingle all the way cpx.start_tone(e4) time.sleep(qn) cpx.stop_tone() cpx.start_tone(g4) time.sleep(qn) cpx.stop_tone() cpx.start_tone(c4) time.sleep(dqn) cpx.stop_tone() cpx.start_tone(d4) time.sleep(en) cpx.stop_tone() cpx.start_tone(e4) time.sleep(wn) cpx.stop_tone() That's very straightforward -- other than looping the initial phrase twice, it repeats three commands over and over again for every note of the song. You can imagine that this would get really long, quickly! The second method involves packing the entire set of notes and durations into a two dimensional array, like this: # jingle bells jingle_bells_song = [[E4, quarter_note], [E4, quarter_note], [E4, half_note], [E4, quarter_note], [E4, quarter_note], [E4, half_note], [E4, quarter_note], [G4, quarter_note], [C4, dotted_quarter_note], [D4, eighth_note], [E4, whole_note]] You can see how each pair in the list is a note pitch, followed by its play duration. We can then play that song with a few lines of code that iterate through the array, playing and pausing for the values one pair at a time: for n in range(len(jingle_bells_song)): cpx.start_tone(jingle_bells_song[n][0]) time.sleep(jingle_bells_song[n][1]) cpx.stop_tone() Also note how the number of times needed to iterate through the loop is derived from querying the length of the jingle_bells_song array with the len() command. This way the number of iterations will always match the number of Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 12 of 32

notes we add to or subtract from the song. If we were to instead hard code it with the number of notes like this: for n in range(11) we would need to constantly update that value while working on the song. No fun! Then, we'll define a second song, Let It Snow: if song_number == 2: # Let It Snow let_it_snow_song = [[B4, dotted_quarter_note], [A4, eighth_note], [G4, quarter_note], [G4, dotted_quarter_note], [F4, eighth_note], [E4, quarter_note], [E4, dotted_quarter_note], [D4, eighth_note], [C4, whole_note]] Once all of that has been defined, we'll play through Jingle Bells once: play_song(1) # play music on start Main Loop! Now, we get to the main loop, this is what will repeat over and over again. The first thing to do is set up some variables and math to compute total acceleration from movement on all three axes of the accelerometer. while True: # check for shaking # Compute total acceleration x_total = 0 y_total = 0 z_total = 0 for count in range(10): x, y, z = cpx.acceleration x_total = x_total + x y_total = y_total + y z_total = z_total + z time.sleep(0.001) x_total = x_total / 10 y_total = y_total / 10 z_total = z_total / 10 total_accel = math.sqrt(x_total*x_total + y_total*y_total + z_total*z_total) Now, we'll have the total_accel value to compare to a threshold of 30 that we set at the top of the program called ROLL_THRESHOLD. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 13 of 32

# Check for rolling if total_accel > ROLL_THRESHOLD: roll_start_time = time.monotonic() new_roll = True rolling = True print('shaken') # Rolling momentum # Keep rolling for a period of time even after shaking stops if new_roll: if time.monotonic() - roll_start_time > 2: # seconds to run rolling = False When shaking is detected, we will run the fade_pixels function twice, first with skyblue, and then with white. We'll then fill all pixels with a bright white! # Light show if rolling: fade_pixels(skyblue) fade_pixels(white) cpx.pixels.brightness = 0.8 cpx.pixels.fill(white) Lastly, when the shaking has stopped, we'll play the second song and then fade_pixels to green. elif new_roll: new_roll = False # play a song! play_song(2) #return to resting color fade_pixels(green) cpx.pixels.brightness = 0.05 cpx.pixels.fill(green) From this point, the snow globe will stay lit green, waiting to be shaken again! Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 14 of 32

Make the Snow Globe Globe Preparation Begin by preparing the snow globe. First, you'll fill it nearly to the top with distilled water. Next, to make the water more viscous, and give the glitter snowflakes more hang time, add 2 tsp. of glycerin to the water and stir it up well to incorporate. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 15 of 32

Now, it's glitter time! You can choose the color and amount to suit -- I used 1 tsp. of white and 1/2 tsp. of silver. Add it to the water and stir. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 16 of 32

Pretty! Shiny!! Electronics Next we'll add the electronics to the globe. The lid area is completely dry -- separated from the globe's water by the plug, which we'll add later, including an adhesive seal for safety. Battery Power Using a screwdriver, remove the belt clip from your AAA battery pack. We'll used the pack as a base, so we need it to be flat. Insert the batteries into the pack and close the lid. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 17 of 32

Use the double stick foam tape to affix the pack to the lid with the switch end facing the lid top, and overhanging for switch access as shown Mark and cut a hole in the lid for the battery JST connector to pass through Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 18 of 32

Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 19 of 32

Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 20 of 32

Connect the JST plug to the Circuit Playground Express and then affix the board to the inside of the lid with double stick foam tape. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 21 of 32

The lid and Circuit Playground Express are now ready to be screwed into place later, once we've added our figurine to the snow globe. Add the Figurine You can choose anything water resistant you like to display within your snow globe! LEGO figures, tiny horses, a collection of cursed D20 dice, it's really up to you! I decided to 3D print an AdaBot figurine. This one was created by the Ruiz Bros. for the Adafruit Chess Set. I modified the base slightly to that it would be a smaller diameter and allow more light in from the bottom, as that's where our NeoPixels are. You can download the files here and print them if you like. https://adafru.it/afm https://adafru.it/afm After printing, I painted Adabot's lightning bolt and eyes with some acrylic paint and a small brush, then sealed it with spray lacquer when it was dry. I used a bit of CA glue to join the two halves. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 22 of 32

Attach the Figure to the Plug You can use E6000 (or Goop) adhesive to glue the base of your figure to the top of the snow globe's plug, then let it dry, up to 24 hours. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 23 of 32

Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 24 of 32

Take the Plunge When the figure's glue has dried, it's time to make it take the plunge! Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 25 of 32

First, make sure you do this over a sink or bowl! Push the figure and plug down slowly, displacing any water to get a nice, full globe. If there's too much air, add water. The plug is held in place by the pressure of the lid, but it's best to seal it with some glue or caulking just to be sure there are no leaks. I used more E6000 here. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 26 of 32

Spread a thin layer of glue around the outer rim and sides of the plug Push the plug into place Wipe off any excess Allow glue time to dry Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 27 of 32

Screw on the Lid Once the plug's glue has dried and you confirm that it's well sealed from any leaks, you can screw on the lid/circuit Playground Express/battery pack. Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 28 of 32

Use the Snow Globe Congratulations! You've built your CircuitPython Snow Globe, and now it's time to shake it up and enjoy! Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 29 of 32

Turn on the battery pack's switch. The lights will come up, and you'll be treated to a song. Pick it up and give it a good shake! Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 30 of 32

Enjoy the lights and snowfall. Finally, another song plays, and the lights return to the festive green! Adafruit Industries https://learn.adafruit.com/circuitpython-snow-globe Page 31 of 32

Adafruit Industries Last Updated: 2018-08-22 04:04:18 PM UTC Page 32 of 32