# Candy Bucket GIF Player Eyes

## Overview

https://www.youtube.com/watch?v=HfMBpSW_3nk

![](https://cdn-learn.adafruit.com/assets/assets/000/080/905/medium800thumb/projects_GuideGifGoodBadCandy.jpg?1568647861)

Create not-so-subtle candy preference GIF eyes for your trick-or-treat bucket! This is a public service that will assist others in providing you with only the good candy, and none of the bad candy this Halloween!

The MONSTER M4SK can play back your animated GIFs, stored right on the board's QSPI -- use the built-in buttons to switch between them, or let them automatically cycle.

## Parts
### Adafruit MONSTER M4SK - DIY Electronic Eyes Mask

[Adafruit MONSTER M4SK - DIY Electronic Eyes Mask](https://www.adafruit.com/product/4343)
 **Peep dis!** Have you always wanted to have another pair of eyes on the back of your head? Or outfit your costume with big beautiful orbs? The MONSTER M4SK [is like the Hallowing](https://www.adafruit.com/product/3900) but _twice_ as good, with two gorgeous...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4343)
[Related Guides to the Product](https://learn.adafruit.com/products/4343/guides)
![MONSTER M4SK DIY Electronic Face mask.  Two Screens Display Eyes that blink and dart up and down.](https://cdn-shop.adafruit.com/product-videos/640x480/4343-00.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)

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

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

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

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

### Black Nylon Machine Screw and Stand-off Set – M2.5 Thread

[Black Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3299)
Totaling 380 pieces, this **M2.5 Screw Set** &nbsp;is a must-have for your workstation.&nbsp;You'll have enough screws, nuts, and hex standoffs to fuel your maker tendencies&nbsp;for days on end! M2.5 size screws fit almost all of the Adafruit breakout/dev board mounting holes...

In Stock
[Buy Now](https://www.adafruit.com/product/3299)
[Related Guides to the Product](https://learn.adafruit.com/products/3299/guides)
![Black Nylon Screw and Stand-off Set with M2.5 Threads, kit box](https://cdn-shop.adafruit.com/640x480/3299-00.jpg)

In addition to these parts, you'll also need:

- a classic, plastic candy bucket
- marker
- awl or thin screwdriver
- hobby knife
- double-stick foam tape or velcro for battery attachement

# Candy Bucket GIF Player Eyes

## Add GIFs to your MONSTER M4SK

## Board Prep and Overview

This project uses the typical procedure for prepping the MONSTER M4SK, plus, it follows the basic process for playing animated GIFs on a SAMD51 board with Arcada display.

Our [**MONSTER M4SK guide**](https://learn.adafruit.com/adafruit-monster-m4sk-eyes/quickstart) walks through the process of setting up the board for the first time. And, our [**Arcada Animated GIF Display**](https://learn.adafruit.com/pyportal-animated-gif-display)guide goes over the specifics of GIF playback. There are a few steps to these processes:

1. Get the onboard flash filesystem working.&nbsp;_If your MONSTER M4SK board already shows up as a flash drive called “CIRCUITPY,” you can skip these next steps and go straight to converting your GIFs!_
2. Create a directory on the CIRCUITPY drive called `/gifs`
3. Add animated .gif files to the `/gifs` directory you just made
4. Bootload the M4SK with the animated GIF code .uf2

![](https://cdn-learn.adafruit.com/assets/assets/000/080/913/medium800/projects__Users_JEP_Dropbox__Personal__AdafruitProjects2_pumpkineyes.jpg?1568651471)

## Convert your GIF

The good news is that you do not have to do any particularly hairy transformations with your GIFs to get them to display - you don't have to make them into header files or anything. However, we do have to perform some steps to make them appear nicely on the TFT you're using

- Reduce size to no larger than 240 wide x 240 tall
- Remove transparent pixels (sometimes called _de-optimization_) because it slows down our decoding
- Reduce colors so we don't have to work as hard to decode
- Reduce frames if it makes sense to

This GIF viewer isn't good for detailed, high-frame-rate GIFs. Keep it simple and you'll be happy with the results!

[This page from the Arcada GIF Display guide](https://learn.adafruit.com/pyportal-animated-gif-display/convert-your-gif) walks you through the entire process!

Here's an example GIF file you can check out if you like. Download and uncompress the .zip file below.

[pumpkineyes_gif.zip](https://cdn-learn.adafruit.com/assets/assets/000/080/909/original/pumpkineyes_gif.zip?1568650925)
![](https://cdn-learn.adafruit.com/assets/assets/000/080/908/medium800thumb/projects_pumpkineyes_orange2.jpg?1568650888)

## Good and Bad Candy GIFs

With the exception of everyone knowing that candy corn is the best Halloween candy in the whole entire world, there may be some allowances for personal preference.

So, you may want to customize your Good and Bad Candy GIFs. But if you want to get started with _my_ picks, here are the GIFs! Download and uncompress the .zip file below.

[good_bad_gifs.zip](https://cdn-learn.adafruit.com/assets/assets/000/080/912/original/good_bad_gifs.zip?1568651160)
![](https://cdn-learn.adafruit.com/assets/assets/000/080/910/medium800thumb/projects_goodcandy.jpg?1568651121)

![](https://cdn-learn.adafruit.com/assets/assets/000/080/911/medium800thumb/projects_badcandy.jpg?1568651127)

## UF2 File

Once you've got a GIF (or a few GIFs) ready, it's time to add the code that will play them for you, and then put the GIFs on the board. Get back to bootloader mode on your board by double clicking the reset button. You'll see the MASKM4BOOT drive appear.

Then, download the UF2 file linked here and drag onto the board.

[M4SK_GIF_player.UF2](https://cdn-learn.adafruit.com/assets/assets/000/081/081/original/M4SK_GIF_player.UF2?1568841290)
![](https://cdn-learn.adafruit.com/assets/assets/000/080/915/medium800/projects__Users_JEP_Dropbox__Personal__AdafruitProjects2_pumpkineyes_2.jpg?1568653882)

## GIF Drag

Once the file finishes copying, the board will automatically reboot, now running the GIF player code! Plus, it will show up as a CIRCUITPY drive.

Create a directory on the CIRCUITPY drive called `/gifs`

Then, simply drag the GIF files into the /gifs directory you made on the M4SK's CIRCUITPY drive.

![](https://cdn-learn.adafruit.com/assets/assets/000/080/914/medium800/projects__Users_JEP_Dropbox__Personal__AdafruitProjects2_pumpkineyes_candy_and__Volumes_CIRCUITPY.jpg?1568653724)

## Config File

The last step is to save this configuration file to the root directory of CIRCUITPY drive. It is the `arcada_config.json` file. You can make adjustments here to settings such as brightness and GIF playback time.

```
    {"volume":255,"brightness":255,"seconds_per_gif":5}
```

[See this page](https://learn.adafruit.com/pyportal-animated-gif-display/customization) for more details on the configuration file.

You can press the **A** button ( **S10** on the PCB) on the MONSTER M4SK and it will start playing your animated GIFs! Press the&nbsp; **Up&nbsp;** button ( **S11&nbsp;** on the PCB) to advance to the next GIF, or&nbsp; **Down&nbsp;** button ( **S9&nbsp;** on the PCB) to go back to the previous one.

![](https://cdn-learn.adafruit.com/assets/assets/000/080/916/medium800thumb/projects_flamegifsrunning.jpg?1568655706)

If you want to get even fancier, you can build the code in Arduino using the Arcada libraries. [Have a look at this guide](https://learn.adafruit.com/pyportal-animated-gif-display/arduino-libraries) for details.

Next, we'll mount the MONSTER M4SK to the candy bucket.

# Candy Bucket GIF Player Eyes

## Mount the M4SK on the Bucket

![](https://cdn-learn.adafruit.com/assets/assets/000/080/917/medium800/projects_bucket_8038_2k.jpg?1568655861)

We'll use nylon M2.5 screws and standoffs to mount the M4SK to the bucket -- this is a very nice, sturdy way to mount it, but you can also go quick and easy with double stick foam tape or Velcro if you're in a hurry!

## Mounting Holes

Position the M4SK where you want it and then mark four hole positions using a marker, as shown.

Carefully poke holes through the four positions using an awl or thin screwdriver.

![projects_bucket_8040_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/918/medium640/projects_bucket_8040_2k.jpg?1568655885)

![projects_bucket_8041_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/919/medium640/projects_bucket_8041_2k.jpg?1568655925)

![projects_bucket_8048_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/920/medium640/projects_bucket_8048_2k.jpg?1568655959)

![projects_bucket_8052_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/921/medium640/projects_bucket_8052_2k.jpg?1568655967)

![projects_bucket_8061_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/922/medium640/projects_bucket_8061_2k.jpg?1568655976)

## Mounting Hardware

Using eight short screws (M2.5 x 4mm), two short standoffs (M2.5 x 6mm), and two medium standoffs (M2.5 x 10mm), fasten the hardware to the mask and the bucket as shown.

![projects_bucket_8063_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/923/medium640/projects_bucket_8063_2k.jpg?1568656002)

![projects_bucket_8064_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/924/medium640/projects_bucket_8064_2k.jpg?1568656154)

![projects_bucket_8066_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/925/medium640/projects_bucket_8066_2k.jpg?1568656161)

![projects_bucket_8069_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/926/medium640/projects_bucket_8069_2k.jpg?1568656167)

![projects_bucket_8070_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/927/medium640/projects_bucket_8070_2k.jpg?1568656176)

![projects_bucket_8068_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/928/medium640/projects_bucket_8068_2k.jpg?1568656183)

## Battery Power

Plug a small LiPoly battery into the MONSTER M4SK battery port and then tuck the battery in the space behind the mask.

You can use some double-stick foam tape to secure the battery in place.

![projects_bucket_8071_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/929/medium640/projects_bucket_8071_2k.jpg?1568656257)

![projects_bucket_8072_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/930/medium640/projects_bucket_8072_2k.jpg?1568656268)

![projects_bucket_8076_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/932/medium640/projects_bucket_8076_2k.jpg?1568656295)

![projects_bucket_8074_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/933/medium640/projects_bucket_8074_2k.jpg?1568656305)

## USB Port Access

You will want to plug in a USB cable to charge the M4SK battery or upload different GIF animations. If your bucket shape doesn't allow easy access, use a hobby knife to cut a slit into the bucket as shown here.

![projects_bucket_8078_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/935/medium640/projects_bucket_8078_2k.jpg?1568656354)

![projects_bucket_8077_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/936/medium640/projects_bucket_8077_2k.jpg?1568656362)

![projects_bucket_8080_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/937/medium640/projects_bucket_8080_2k.jpg?1568656375)

![](https://cdn-learn.adafruit.com/assets/assets/000/080/938/medium800thumb/projects_GuideGifGoodBadCandy.jpg?1568656498)


## Featured Products

### Adafruit MONSTER M4SK - DIY Electronic Eyes Mask

[Adafruit MONSTER M4SK - DIY Electronic Eyes Mask](https://www.adafruit.com/product/4343)
 **Peep dis!** Have you always wanted to have another pair of eyes on the back of your head? Or outfit your costume with big beautiful orbs? The MONSTER M4SK [is like the Hallowing](https://www.adafruit.com/product/3900) but _twice_ as good, with two gorgeous...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4343)
[Related Guides to the Product](https://learn.adafruit.com/products/4343/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)
### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

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

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

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

## Related Guides

- [Adafruit MONSTER M4SK](https://learn.adafruit.com/adafruit-monster-m4sk-eyes.md)
- [CustomEyesation: DIY Monster M4SK Graphics](https://learn.adafruit.com/customeyesation-diy-monster-m4sk-graphics.md)
- [Fish Head MONSTER M4SK Eyes](https://learn.adafruit.com/wide-set-monster-m4sk-creature-eyes.md)
- [Goose Game M4SK Controller](https://learn.adafruit.com/goose-game-m4sk-controller.md)
- [Monster M4sk Is Watching You](https://learn.adafruit.com/monster-m4sk-is-watching-you.md)
- [Add MONSTER M4SK to your Costume Mask](https://learn.adafruit.com/add-monster-m4sk-to-your-costume-mask.md)
- [Boglin MONSTER M4SK Mod](https://learn.adafruit.com/boglin-monster-m4sk-mod.md)
- [Monster Mask Case](https://learn.adafruit.com/monster-mask-case.md)
- [Spruce Up a Costume with MONSTER M4SK Eyes and Voice](https://learn.adafruit.com/spruce-up-a-costume-with-monster-m4sk-eyes-and-voice.md)
- [MONSTER M4SK Toon Hat](https://learn.adafruit.com/monster-mask-augmented-eyes-toon-hat.md)
- [Tree with Animated Eyes and Motion Sensor](https://learn.adafruit.com/tree-ent-sculpture-with-animated-eyes.md)
- [Cappy Monster M4sk with Animated Eyes](https://learn.adafruit.com/cappy-monster-m4sk.md)
- [Animatronic Fizzgig MonsterM4sk Puppet](https://learn.adafruit.com/animatronic-fizzgig-monsterm4sk-puppet.md)
- [Velociraptor Voice and Eye Upgrade with MONSTER M4SK](https://learn.adafruit.com/hand-puppet-voice-and-eye-upgrade-with-monster-m4sk.md)
- [EYE SHOOTOUT: Contrasting Open Source and Big Retail Electronics](https://learn.adafruit.com/eye-shootout-contrasting-open-source-and-big-retail-electronics.md)
- [Living Ventriloquist Dummy with MONSTER M4SK Eyes](https://learn.adafruit.com/living-ventriloquist-dummy-with-monster-m4sk-eyes.md)
