# Animated Flying Toaster OLED Jewelry

## Overview

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

The flying toaster screen saver from After Dark makes great inspiration for a retro project using 3d printing, and DIY electronics. In this project we'll show you how to make very cute and adorable electronic jewelry.

You can get the parts to build this project from the shop on adafruit dot com. The adafruit pro trinket is a micro controller perfect for miniture projects and wearables. Combined with the lipoly backpack, you can power and recharge this circuit over micro USB.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/278/medium800thumb/components_hero-loop2.jpg?1448312954)

## Prerequisite Guides

We recommend walking-through the following tutorials below before starting this project. These guides will help you get familiar with the components and get setup and configured with the Arduino IDE and libraries.

- [Introducing&nbsp;Pro Trinket](../../../../introducing-pro-trinket)
- [Adafruit Pro Trinket LiPoly/LiIon Backpack](../../../../adafruit-pro-trinket-lipoly-slash-liion-backpack)
- [Monochrome OLED Breakouts](../../../../monochrome-oled-breakouts)

## Parts

We have all the lovely components and tools to build this project. Be sure to check out the features products on the right sidebar.

- [Pro Trinket](https://www.adafruit.com/products/2000) 5V 16MHz version
- [OLED Display](https://www.adafruit.com/product/938)
- [Trinket LiIon/LiPoly Backpack Add-On](https://www.adafruit.com/product/2124)
- [Fast Vibration Sensor Switch (Easy to trigger)](https://www.adafruit.com/product/1766)
- [Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/products/805)

![](https://cdn-learn.adafruit.com/assets/assets/000/020/247/medium800/components_parts.jpg?1413229849)

## Tools & Supplies

You'll need a couple of hand tools and accessories to assist you in the build.&nbsp;

- [Solder Iron](https://www.adafruit.com/products/1204 "Link: https://www.adafruit.com/products/1204") + [Solder](https://www.adafruit.com/products/734 "Link: https://www.adafruit.com/products/734")
- [Silicone&nbsp;Wire](https://www.adafruit.com/products/1877 "Silicone Wire")
- [PLA&nbsp;Filament](https://www.adafruit.com/search?q=ninjaflex "Link: https://www.adafruit.com/search?q=ninjaflex")
- [3D Printer](https://www.adafruit.com/search?q=3d+printer "Link: https://www.adafruit.com/search?q=3d+printer")

# Animated Flying Toaster OLED Jewelry

## 3D Printing

## FDM 3D Printing

These parts are optimized to print with desktop 3D Printers capable of printing in ABS or PLA material with a minium build area of 100mm x 100mm x 90mm.&nbsp;&nbsp;The two&nbsp;parts are&nbsp;designed to print **without** any support material.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/020/248/medium800/components_3d-parts2.jpg?1413229862)

[Download STLs](http://www.thingiverse.com/thing:499980)
[Edit 3D files](http://www.123dapp.com/Project/Animated-Flying-Toaster-OLED-Jewelry/2926153)
## Slicing Software

The recommend settings above should work with most slicing software. However, you are encouraged to use your own settings since 3D printers and slicing software will vary from printer to printer.

## PLA or ABS Material

We recommend using PLA material for an easier print with high quality. The tolerance has been tested with PLA filament but should also work with ABS. The parts do not require any support material or a raft.

# Animated Flying Toaster OLED Jewelry

## Code

Using the OLED display with Arduino sketches requires that two libraries be installed: **Adafruit\_SSD1306** , which handles the low-level communication with the hardware, and **Adafruit\_GFX** , which builds atop this to add graphics functions like lines, circles and text.

In recent versions of the Arduino IDE software (1.6.2 and later), this is most easily done through the Arduino Library Manager, which you’ll find in the “Sketch” menu:&nbsp; **Sketch→Include&nbsp;Library→Manage Libraries…**

![](https://cdn-learn.adafruit.com/assets/assets/000/065/502/medium800/projects_libmanager.png?1541817788)

Enter “ssd1306” in the search field, locate the Adafruit SSD1306 library and select “Install” (or “Upgrade” if you have an older version). Then repeat the same for “gfx” and the Adafruit GFX library, “busio” and the Adafruit BusIO library (newer Arduino IDE releases will handle this dependency automatically when installing GFX).

# The Old Way…

If you’re using an earlier version of the Arduino IDE software and need to install libraries manually, or if you’d like to download the library source code to look inside, both of these can be found on Github.

- [Adafruit SSD1306 library repository](https://github.com/adafruit/Adafruit_SSD1306 "Link: https://github.com/adafruit/Adafruit\_SSD1306")
- [Adafurit\_GFX library repository](https://github.com/adafruit/Adafruit-GFX-Library)
- [Adafruit\_BusIO library repository](https://github.com/adafruit/Adafruit_BusIO)

Or here are links directly to the ZIP files:

[Download Adafruit_SSD1306 Library](https://github.com/adafruit/Adafruit_SSD1306/archive/master.zip)
[Download Adafruit_GFX Library](https://github.com/adafruit/Adafruit-GFX-Library/archive/master.zip)
[Download Adafruit_BusIO Library](https://github.com/adafruit/Adafruit_BusIO/archive/master.zip)
After uncompressing, the folders should be renamed (if necessary) to **Adafruit\_SSD1306** , **Adafruit\_GFX** &nbsp;and **Adafruit\_BusIO**. The first should contain the files Adafruit\_SSD1306.cpp and Adafruit\_SSD1306.h (plus a few extra files). Sometimes unZIPping creates a nested Adafruit\_SSD1306 folder within another folder…you don’t want that. The secpmd should contain Adafruit\_GFX.cpp and Adafruit\_GFX.h (plus some extra files) and so forth.

Place these folders in your (home)/Documents/Arduino/Libraries folder.&nbsp;You may need to create the **libraries** subfolder if its your first library. Then&nbsp; **restart** the Arduino IDE.

We also have a great tutorial on Arduino library installation here:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

# The Code

As written, this will work on an **Adafruit Pro Trinket** or an **Arduino Uno**. It makes reference to some specific pins and hardware features (sleep, interrupts, etc.) that **may not work on other boards** without some code changes and deeper understanding of the hardware.

```auto
// Animated pendant for Adafruit Pro Trinket and SSD1306 OLED display,
// inspired by the After Dark "Flying Toasters" screensaver.
// Triggered with vibration switch between digital pins 3 and 4.

#include &lt;avr/sleep.h&gt;
#include &lt;avr/power.h&gt;
#include &lt;SPI.h&gt;
#include &lt;Wire.h&gt;
#include &lt;Adafruit_GFX.h&gt;
#include &lt;Adafruit_SSD1306.h&gt;
#include "bitmaps.h" // Toaster graphics data is in this header file

#define EXTRAGND   4 // Extra ground pin for vibration switch
#define OLED_DC    5 // OLED control pins are configurable.
#define OLED_CS    6 // These are different from other SSD1306 examples
#define OLED_RESET 8 // because the Pro Trinket has no pin 2 or 7.
// Hardware SPI for Data &amp; Clk -- pins 11 &amp; 13 on Uno or Pro Trinket.
Adafruit_SSD1306 display(128, 64, &amp;SPI, OLED_DC, OLED_RESET, OLED_CS);

#define N_FLYERS   5 // Number of flying things

struct Flyer {       // Array of flying things
  int16_t x, y;      // Top-left position * 16 (for subpixel pos updates)
  int8_t  depth;     // Stacking order is also speed, 12-24 subpixels/frame
  uint8_t frame;     // Animation frame; Toasters cycle 0-3, Toast=255
} flyer[N_FLYERS];

uint32_t startTime;

void setup() {

  randomSeed(analogRead(2));           // Seed random from unused analog input
  DDRB  = DDRC  = DDRD  = 0x00;        // Set all pins to inputs and
  PORTB = PORTC = PORTD = 0xFF;        // enable pullups (for power saving)
  pinMode(EXTRAGND, OUTPUT);           // Set one pin low to provide a handy
  digitalWrite(EXTRAGND, LOW);         // ground point for vibration switch
  display.begin(SSD1306_SWITCHCAPVCC); // Init screen
  display.clearDisplay();
  for(uint8_t i=0; i&lt;N_FLYERS; i++) {  // Randomize initial flyer states
    flyer[i].x     = (-32 + random(160)) * 16;
    flyer[i].y     = (-32 + random( 96)) * 16;
    flyer[i].frame = random(3) ? random(4) : 255; // 66% toaster, else toast
    flyer[i].depth = 10 + random(16);             // Speed / stacking order
  }
  qsort(flyer, N_FLYERS, sizeof(struct Flyer), compare); // Sort depths

  // AVR peripherals that aren't used by this code are disabled to further
  // conserve power, and may take certain Arduino functionality with them.
  // If you adapt this code to other projects, may need to re-enable some.
  power_adc_disable();    // Disable ADC (no analogRead())
  power_twi_disable();    // Disable I2C (no Wire library)
  power_usart0_disable(); // Disable UART (no Serial)
  power_timer1_disable();
  power_timer2_disable();

  EICRA = _BV(ISC11); // Falling edge of INT1 (pin 3) generates an interrupt
  EIMSK = _BV(INT1);  // Enable interrupt (vibration switch wakes from sleep)

  startTime = millis();
}

void loop() {
  uint8_t i, f;
  int16_t x, y;
  boolean resort = false;     // By default, don't re-sort depths

  display.display();          // Update screen to show current positions
  display.clearDisplay();     // Start drawing next frame

  for(i=0; i&lt;N_FLYERS; i++) { // For each flyer...

    // First draw each item...
    f = (flyer[i].frame == 255) ? 4 : (flyer[i].frame++ &amp; 3); // Frame #
    x = flyer[i].x / 16;
    y = flyer[i].y / 16;
    display.drawBitmap(x, y, (const uint8_t *)pgm_read_word(&amp;mask[f]), 32, 32, BLACK);
    display.drawBitmap(x, y, (const uint8_t *)pgm_read_word(&amp;img[ f]), 32, 32, WHITE);

    // Then update position, checking if item moved off screen...
    flyer[i].x -= flyer[i].depth * 2; // Update position based on depth,
    flyer[i].y += flyer[i].depth;     // for a sort of pseudo-parallax effect.
    if((flyer[i].y &gt;= (64*16)) || (flyer[i].x &lt;= (-32*16))) { // Off screen?
      if(random(7) &lt; 5) {         // Pick random edge; 0-4 = top
        flyer[i].x = random(160) * 16;
        flyer[i].y = -32         * 16;
      } else {                    // 5-6 = right
        flyer[i].x = 128         * 16;
        flyer[i].y = random(64)  * 16;
      }
      flyer[i].frame = random(3) ? random(4) : 255; // 66% toaster, else toast
      flyer[i].depth = 10 + random(16);
      resort = true;
    }
  }
  // If any items were 'rebooted' to new position, re-sort all depths
  if(resort) qsort(flyer, N_FLYERS, sizeof(struct Flyer), compare);

  if((millis() - startTime) &gt;= 15000L) {         // If 15 seconds elapsed...
    display.ssd1306_command(SSD1306_DISPLAYOFF); // Screen off
    power_spi_disable();                         // Disable remaining periphs
    power_timer0_disable();
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);         // Deepest sleep
    sleep_mode();
    // Execution resumes here on wake.
    power_spi_enable();                          // Re-enable SPI
    power_timer0_enable();                       // and millis(), etc.
    display.ssd1306_command(SSD1306_DISPLAYON);  // Main screen turn on
    startTime = millis();                        // Save wake time
  }
}

// Flyer depth comparison function for qsort()
static int compare(const void *a, const void *b) {
  return ((struct Flyer *)a)-&gt;depth - ((struct Flyer *)b)-&gt;depth;
}

ISR(INT1_vect) { } // Vibration switch wakeup interrupt
```

The graphics data is stored in a separate source file. Use the “new tab” button (near top right of Arduino editor window), name the new file “bitmaps.h,”&nbsp;then copy and paste the following into it:

```auto
#include &lt;Arduino.h&gt;

const uint8_t PROGMEM
 toastermask0[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
  0x00, 0x20, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00,
  0x00, 0x10, 0x00, 0x00, 0x00, 0x43, 0xF8, 0x00,
  0x00, 0x1F, 0x80, 0x00, 0x00, 0x7C, 0x3F, 0x80,
  0x01, 0xF1, 0xF8, 0xF0, 0x07, 0xC7, 0xC7, 0x00,
  0x0F, 0x1F, 0x08, 0x2B, 0x1E, 0x7C, 0x11, 0x00,
  0x04, 0xF0, 0x20, 0x56, 0x61, 0xE4, 0x22, 0x00,
  0x78, 0x48, 0x40, 0xA8, 0x4E, 0x10, 0x44, 0x00,
  0x53, 0x90, 0x81, 0xF8, 0x5C, 0xA0, 0x90, 0x58,
  0x7C, 0xA1, 0x07, 0x90, 0x74, 0xA1, 0x21, 0x38,
  0x7F, 0xB5, 0x0E, 0x30, 0x77, 0xB0, 0x90, 0x78,
  0x7F, 0xB4, 0x60, 0xF0, 0x77, 0xBB, 0x03, 0xE0,
  0x7F, 0xBC, 0x0F, 0xC0, 0x77, 0xBF, 0xFF, 0x00,
  0x7F, 0xBF, 0xFC, 0x00, 0x3F, 0xBF, 0xF0, 0x00,
  0x1F, 0xBF, 0xC0, 0x00, 0x07, 0xBE, 0x00, 0x00,
  0x01, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
 toastermask1[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0xF8, 0x00,
  0x00, 0x1F, 0x80, 0x00, 0x00, 0x7C, 0x3F, 0x80,
  0x01, 0xF1, 0xF8, 0x00, 0x07, 0xC7, 0xC1, 0xE0,
  0x0F, 0x1F, 0x06, 0x10, 0x1E, 0x7C, 0x00, 0x00,
  0x04, 0xF0, 0x07, 0xF0, 0x61, 0xE4, 0x18, 0x08,
  0x78, 0x48, 0x20, 0x80, 0x4E, 0x10, 0x40, 0x2B,
  0x53, 0x90, 0x81, 0x00, 0x5C, 0xA0, 0x80, 0x58,
  0x7C, 0xA1, 0x02, 0x00, 0x74, 0xA1, 0x28, 0xB8,
  0x7F, 0xB5, 0x0F, 0xF0, 0x77, 0xB0, 0x90, 0x78,
  0x7F, 0xB4, 0x60, 0xF0, 0x77, 0xBB, 0x03, 0xE0,
  0x7F, 0xBC, 0x0F, 0xC0, 0x77, 0xBF, 0xFF, 0x00,
  0x7F, 0xBF, 0xFC, 0x00, 0x3F, 0xBF, 0xF0, 0x00,
  0x1F, 0xBF, 0xC0, 0x00, 0x07, 0xBE, 0x00, 0x00,
  0x01, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
 toastermask2[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xF8, 0x00,
  0x00, 0x1F, 0x80, 0x00, 0x00, 0x7C, 0x3F, 0x80,
  0x01, 0xF1, 0xF8, 0x00, 0x07, 0xC7, 0xC1, 0xE0,
  0x0F, 0x1F, 0x06, 0x10, 0x1E, 0x7C, 0x00, 0x00,
  0x04, 0xF0, 0x00, 0x00, 0x61, 0xE4, 0x00, 0x08,
  0x78, 0x48, 0x00, 0x10, 0x4E, 0x10, 0x00, 0x18,
  0x53, 0x90, 0x60, 0x70, 0x5C, 0xA0, 0x9F, 0xC8,
  0x7C, 0xA1, 0x04, 0x92, 0x74, 0xA1, 0x09, 0x24,
  0x7F, 0xB5, 0x02, 0x48, 0x77, 0xB0, 0x80, 0x10,
  0x7F, 0xB4, 0x41, 0x00, 0x77, 0xBB, 0x20, 0x40,
  0x7F, 0xBC, 0x10, 0x00, 0x77, 0xBF, 0xF8, 0x00,
  0x7F, 0xBF, 0xFC, 0x00, 0x3F, 0xBF, 0xF0, 0x00,
  0x1F, 0xBF, 0xC0, 0x00, 0x07, 0xBE, 0x00, 0x00,
  0x01, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
 toastmask[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00,
  0x00, 0x0C, 0x30, 0x00, 0x00, 0x30, 0x0C, 0x00,
  0x00, 0xC2, 0x23, 0x00, 0x07, 0x00, 0x80, 0xC0,
  0x08, 0x25, 0x50, 0x30, 0x10, 0x0B, 0xA8, 0x08,
  0x21, 0x37, 0xF5, 0x04, 0x30, 0x4A, 0xE8, 0x0C,
  0x3C, 0x15, 0x52, 0x34, 0x2B, 0x00, 0x80, 0xEC,
  0x35, 0xC2, 0x23, 0x54, 0x1A, 0xB0, 0x0E, 0xAC,
  0x0D, 0x5C, 0x15, 0x58, 0x03, 0xAB, 0xEA, 0xE0,
  0x00, 0xD5, 0x55, 0x80, 0x00, 0x3A, 0xAE, 0x00,
  0x00, 0x0D, 0x58, 0x00, 0x00, 0x03, 0xE0, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
 toaster0[] = {
  0x00, 0x30, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00,
  0x01, 0xD8, 0x00, 0x00, 0x03, 0x74, 0xF0, 0x00,
  0x07, 0xEF, 0xFE, 0x00, 0x07, 0xBC, 0x07, 0x80,
  0x0F, 0xE0, 0x7F, 0xE0, 0x0F, 0x83, 0xC0, 0x70,
  0x1E, 0x0E, 0x07, 0x08, 0x18, 0x38, 0x38, 0xFF,
  0x30, 0xE0, 0xF7, 0xD4, 0x61, 0x83, 0xEE, 0xFF,
  0x7B, 0x0F, 0xDF, 0xA8, 0x9E, 0x1B, 0xDD, 0xFE,
  0x87, 0xB7, 0xBF, 0x50, 0xB1, 0xEF, 0xBB, 0xF8,
  0xAC, 0x6F, 0x7E, 0x00, 0xA3, 0x5F, 0x6F, 0xA0,
  0x83, 0x5E, 0xF8, 0x68, 0x8B, 0x5E, 0xDE, 0xC0,
  0x80, 0x4A, 0xF1, 0xC8, 0x88, 0x4F, 0x6F, 0x80,
  0x80, 0x4B, 0x9F, 0x08, 0x88, 0x44, 0xFC, 0x10,
  0x80, 0x43, 0xF0, 0x20, 0x88, 0x40, 0x00, 0xC0,
  0x80, 0x40, 0x03, 0x00, 0x40, 0x40, 0x0C, 0x00,
  0x20, 0x40, 0x30, 0x00, 0x18, 0x41, 0xC0, 0x00,
  0x06, 0x4E, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00 },
 toaster1[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xF0, 0x00,
  0x00, 0xF7, 0xFE, 0x00, 0x01, 0xBC, 0x07, 0x80,
  0x03, 0xE0, 0x7F, 0xE0, 0x07, 0x83, 0xC0, 0x70,
  0x0E, 0x0E, 0x07, 0xF8, 0x18, 0x38, 0x3E, 0x18,
  0x30, 0xE0, 0xF9, 0xE8, 0x61, 0x83, 0xFF, 0xF8,
  0x7B, 0x0F, 0xF8, 0x08, 0x9E, 0x1B, 0xE7, 0xF0,
  0x87, 0xB7, 0xDF, 0x7F, 0xB1, 0xEF, 0xBF, 0xD4,
  0xAC, 0x6F, 0x7E, 0xFF, 0xA3, 0x5F, 0x7F, 0xA6,
  0x83, 0x5E, 0xFD, 0xF8, 0x8B, 0x5E, 0xD7, 0x40,
  0x80, 0x4A, 0xF0, 0x08, 0x88, 0x4F, 0x6F, 0x80,
  0x80, 0x4B, 0x9F, 0x08, 0x88, 0x44, 0xFC, 0x10,
  0x80, 0x43, 0xF0, 0x20, 0x88, 0x40, 0x00, 0xC0,
  0x80, 0x40, 0x03, 0x00, 0x40, 0x40, 0x0C, 0x00,
  0x20, 0x40, 0x30, 0x00, 0x18, 0x41, 0xC0, 0x00,
  0x06, 0x4E, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00 },
 toaster2[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00,
  0x00, 0x07, 0xFE, 0x00, 0x00, 0x3C, 0x07, 0x80,
  0x00, 0xE0, 0x7F, 0xE0, 0x03, 0x83, 0xC0, 0x70,
  0x0E, 0x0E, 0x07, 0xF8, 0x18, 0x38, 0x3E, 0x18,
  0x30, 0xE0, 0xF9, 0xE8, 0x61, 0x83, 0xFF, 0xF8,
  0x7B, 0x0F, 0xFF, 0xF8, 0x9E, 0x1B, 0xFF, 0xF0,
  0x87, 0xB7, 0xFF, 0xE8, 0xB1, 0xEF, 0xFF, 0xE0,
  0xAC, 0x6F, 0x9F, 0x88, 0xA3, 0x5F, 0x60, 0x36,
  0x83, 0x5E, 0xFB, 0x6D, 0x8B, 0x5E, 0xF6, 0xDB,
  0x80, 0x4A, 0xFD, 0xB6, 0x88, 0x4F, 0x7F, 0xEE,
  0x80, 0x4B, 0xBE, 0xFC, 0x88, 0x44, 0xDF, 0xBC,
  0x80, 0x43, 0xEF, 0xF8, 0x88, 0x40, 0x07, 0xF0,
  0x80, 0x40, 0x03, 0xE0, 0x40, 0x40, 0x0C, 0xC0,
  0x20, 0x40, 0x30, 0x00, 0x18, 0x41, 0xC0, 0x00,
  0x06, 0x4E, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00 },
 toast[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x03, 0xC0, 0x00, 0x00, 0x0F, 0xF0, 0x00,
  0x00, 0x3D, 0xDC, 0x00, 0x00, 0xFF, 0x7F, 0x00,
  0x07, 0xDA, 0xAF, 0xC0, 0x0F, 0xF4, 0x57, 0xF0,
  0x1E, 0xC8, 0x0A, 0xF8, 0x0F, 0xB5, 0x17, 0xF0,
  0x03, 0xEA, 0xAD, 0xC8, 0x14, 0xFF, 0x7F, 0x10,
  0x0A, 0x3D, 0xDC, 0xA8, 0x05, 0x4F, 0xF1, 0x50,
  0x02, 0xA3, 0xEA, 0xA0, 0x00, 0x54, 0x15, 0x00,
  0x00, 0x2A, 0xAA, 0x00, 0x00, 0x05, 0x50, 0x00,
  0x00, 0x02, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

const uint8_t* const mask[] PROGMEM = {
  toastermask0, toastermask1, toastermask2, toastermask1, toastmask };
const uint8_t* const img[]  PROGMEM = {
  toaster0    , toaster1    , toaster2    , toaster1    , toast     };
```

# Animated Flying Toaster OLED Jewelry

## Assembly

This diagram shows the connections to be made:

![](https://cdn-learn.adafruit.com/assets/assets/000/020/310/medium800/components_diagram.png?1413250299)

The LiPoly backpack sits atop the Pro Trinket on the BUS, G and BAT+ pins, and the power jumpers are modified to connect a switch.

The vibration sensor switch connects to Pro Trinket pins 3 and 4.

The remaining connections are:

However,&nbsp; **the Pro Trinket and display are installed&nbsp;back to back,&nbsp;** so the routing won't exactly follow the diagram above…one side will be in mirror-image. Also, _much_ shorter wire lengths can be used! Here’s the process…

![](https://cdn-learn.adafruit.com/assets/assets/000/020/256/medium800/components_trace-removed.jpg?1413229894)

## Cut Traces

Enable the on and off swtich by cutting the trace between the power switch.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/250/medium800/components_lipoback_sticker.jpg?1413229864)

## Add slide switch

Measure wires for the slide switch and cover the jumper pad so they don't make conect with&nbsp;Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/252/medium800/components_monitor_wire_layout.jpg?1413229878)

## Measure Trinket wires

Align the monitor on top to meaure how long each wire needs to be, add a bit of wiggle room to be safe.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/253/medium800/components_trinket_wires.jpg?1413229886)

## Bend wires into shape

Adjust the wire so they sit&nbsp;in&nbsp;each through hole for monitor.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/254/medium800/components_solder-mointor.jpg?1413229887)

## Bend wires tips

Secure the monitor in place while soldering by bending the wire tips.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/255/medium800/components_vib-sensor-pins.jpg?1413229892)

## Vibration Sensor

Add the vibration sensor between pins 4 and 3

![](https://cdn-learn.adafruit.com/assets/assets/000/020/258/medium800/components_bend_vib_sensor.jpg?1413229899)

## Bend Vibration sensor pins

Use a pair of flat pliers&nbsp;to hold the end of the vibrations pins while bending them&nbsp;across the Trinket as shown.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/259/medium800/components_slide-switch-shrunck-tube.jpg?1413229901)

## Add Battery

Connect the battery using a small amount of tac to hold it in place.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/020/262/medium800thumb/components_insert-circuit.jpg?1448312928)

## Insert Circuit into case

Slide the complete circuit in&nbsp;at an angle, port side first as shown above.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/263/medium800thumb/components_insert-slide.jpg?1448312943)

## Insert Slide Switch

Wiggle the slide switch into the clips at an angle with a pair of tweezers.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/261/medium800/components_monitor_mount_screw.jpg?1413229908)

## Mount monitor

Use a #4 screw to securly mount the monitor into the case.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/264/medium800thumb/components_insert-back-screw.jpg?1448312945)

## Back cover

Align the back cover and use another #4 screw to tight to the back.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/266/medium800/components_hero-hold.jpg?1413229965)

## Wear it!

Add a split ring and necklace and rock out to retro goodness!


## Featured Products

### Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic

[Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic](https://www.adafruit.com/product/938)
These displays are small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is...

In Stock
[Buy Now](https://www.adafruit.com/product/938)
[Related Guides to the Product](https://learn.adafruit.com/products/938/guides)
### Adafruit Pro Trinket - 5V 16MHz

[Adafruit Pro Trinket - 5V 16MHz](https://www.adafruit.com/product/2000)
 **Deprecation Warning: The Pro Trinket bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Pro Trinket so that people can maintain some older projets, we no longer recommend it.** Please...

In Stock
[Buy Now](https://www.adafruit.com/product/2000)
[Related Guides to the Product](https://learn.adafruit.com/products/2000/guides)
### Fast Vibration Sensor Switch (Easy to trigger)

[Fast Vibration Sensor Switch (Easy to trigger)](https://www.adafruit.com/product/1766)
The "poor man's" accelerometer/motion sensor! These spring-vibration switches are **high sensitivity** non-directional vibration induced trigger switches. Inside is a very soft spring coiled around a long metal pin. When the switch is moved, the spring touches the...

In Stock
[Buy Now](https://www.adafruit.com/product/1766)
[Related Guides to the Product](https://learn.adafruit.com/products/1766/guides)
### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

In Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
### Adafruit LiIon/LiPoly Backpack Add-On for Pro Trinket/ItsyBitsy

[Adafruit LiIon/LiPoly Backpack Add-On for Pro Trinket/ItsyBitsy](https://www.adafruit.com/product/2124)
If you have an ItsyBitsy or Pro Trinket you probably know it's the perfect little size for a portable project. This LiPoly backpack makes it really easy to do! Instead of wiring 2 or 3 boards together to make a charging system, this little PCB sits on top of the PCB and allows a...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2124)
[Related Guides to the Product](https://learn.adafruit.com/products/2124/guides)
### Lithium Ion Polymer Battery - 3.7v 100mAh

[Lithium Ion Polymer Battery - 3.7v 100mAh](https://www.adafruit.com/product/1570)
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 ~100mAh for a total of about 0.4 Wh. If you need a larger battery, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1570)
[Related Guides to the Product](https://learn.adafruit.com/products/1570/guides)
### USB Patterned Fabric Cable - A/MicroB

[USB Patterned Fabric Cable - A/MicroB](https://www.adafruit.com/product/2008)
Oooh it's so soft! And that beautiful&nbsp;pattern! If you have to have visible cables&nbsp;then you might as well have the nicest fabric bound cable with a eye-catching snake-like pattern. &nbsp;That's why we now carry this standard A to micro-B USB cable&nbsp;for USB 1.1 or 2.0....

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2008)
[Related Guides to the Product](https://learn.adafruit.com/products/2008/guides)
### PrintrBot Simple Metal 3D Printer - Black - Assembled

[PrintrBot Simple Metal 3D Printer - Black - Assembled](https://www.adafruit.com/product/1760)
New from Printrbot, the Metal Simple is a brand new rock solid, all metal, fully-assembled Printrbot Simple! As opposed to the [Printrbot Simple Kit](http://www.adafruit.com/products/1735), all of the laser cut wood parts have been replaced by rock solid metal and assembled. In...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1760)
[Related Guides to the Product](https://learn.adafruit.com/products/1760/guides)

## Related Guides

- [Glowing Viking Rune wayFinder](https://learn.adafruit.com/glowing-viking-rune-artifact.md)
- [Supernova Poi](https://learn.adafruit.com/supernova-poi.md)
- [MASLOW: an Open WiFi Detector with Adafruit Pro Trinket and CC3000](https://learn.adafruit.com/wifi-hotspot-finder-adafruit-pro-trinket-cc3000.md)
- [CircuitPython Animated Sprite Pendants](https://learn.adafruit.com/circuitpython-sprite-animation-pendant-mario-clouds-flying-toasters.md)
- [Adafruit OLED Displays for Raspberry Pi](https://learn.adafruit.com/adafruit-oled-displays-for-raspberry-pi.md)
- [Adafruit Pro Trinket LiPoly/LiIon Backpack](https://learn.adafruit.com/adafruit-pro-trinket-lipoly-slash-liion-backpack.md)
- [Trinket “Question Block” Sound Jewelry](https://learn.adafruit.com/trinket-question-block-sound-jewelry.md)
- [Adafriend the Virtual Pet Cube](https://learn.adafruit.com/adafriend.md)
- [Animated Scrolling "Mario Clouds" TFT Jewelry](https://learn.adafruit.com/scrolling-mario-clouds-tft-jewelry.md)
- [Glowy Message Crown](https://learn.adafruit.com/glowy-message-crown.md)
- [DRAFT PUNK](https://learn.adafruit.com/draft-punk.md)
- [Gravity Falls Memory Gun](https://learn.adafruit.com/gravity-falls-memory-gun.md)
- [Wizzy: A Needle Felted Cat](https://learn.adafruit.com/wizzy-a-needle-felted-cat.md)
- [LO-LA59 Droid](https://learn.adafruit.com/lola-droid.md)
- [3D Printed Accessories for Headphones](https://learn.adafruit.com/3d-printed-accessories-for-headphones.md)
