# CircuitPython Media Dial

## Overview

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

This is a DIY multimedia dial. It rotates like a knob and clicks like a mouse. Turn a rotary encoder into a media controller!&nbsp;

&nbsp;

It works well as an assignable USB controller that you can program to do just about anything you want.

&nbsp;

&nbsp;

![3d_printing_hero-mediumB.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/705/medium640/3d_printing_hero-mediumB.jpg?1517935453)

It’s powered by Adafruit’s Circuit Python so you can quickly program it to run key commands in any application.

&nbsp;

So you can use it to edit videos, control youtube or even scroll through long documents.

&nbsp;

Inside the 3D printed knob is a rotary encoder and NeoPixel ring. As you turn the knob, an LED follows the direction making it easy to see where it is.

![3d_printing_hero-scroll.gif](https://cdn-learn.adafruit.com/assets/assets/000/050/708/medium640thumb/3d_printing_hero-scroll.jpg?1517863375)

This uses the Adafruit HID Library for Circuit Python. All of the key codes are listed in the docs so it’s easy to customize your own key commands.

&nbsp;

It’s powered by Adafruit’s Trinket M0 and runs Circuit Python.

![3d_printing_parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/709/medium640/3d_printing_parts.jpg?1517935474)

![3d_printing_flex-perma.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/710/medium640/3d_printing_flex-perma.jpg?1517935475)

## Prerequisite Guides

If your new to electronics and&nbsp;_CircuitPython_, I&nbsp;suggest you walk through the following guides to get the basics. The Adafruit Feather M0 Express&nbsp;guide will walk you through setting it up with CircuitPython. See the DotStar guide for more information on how they work.

- [Collin's Lab –&nbsp;Soldering](../../../collins-lab-soldering/learn-more?view=all)
- [Welcome to CircuitPython!](../../../welcome-to-the-community/welcome-to-the-community)

### Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE

[Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE](https://www.adafruit.com/product/3500)
The&nbsp;Adafruit Trinket M0 may be small, but do not be fooled by its size! It's a tiny microcontroller board, built around the Atmel ATSAMD21, a little chip with _a lot_ of power. We wanted to design a microcontroller board that was small enough to fit into any project, and low...

In Stock
[Buy Now](https://www.adafruit.com/product/3500)
[Related Guides to the Product](https://learn.adafruit.com/products/3500/guides)
![Manicured hand holding Trinket M0.](https://cdn-shop.adafruit.com/640x480/3500-04.jpg)

### NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1463)
Round and round and round they go! 16 ultra bright smart LED NeoPixels are arranged in a circle with 1.75" (44.5mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1463)
[Related Guides to the Product](https://learn.adafruit.com/products/1463/guides)
![Hand holding NeoPixel Ring with 16 x 5050 RGB LED, lit up rainbow](https://cdn-shop.adafruit.com/640x480/1463-00.jpg)

### Filament for 3D Printers in Various Colors and Types

[Filament for 3D Printers in Various Colors and Types](https://www.adafruit.com/product/2080)
Having a 3D printer without filament is sort of like having a regular printer without paper or ink. &nbsp;And while a lot of printers come with some filament there's a good chance you've been printing up a storm and need something new. &nbsp;That's why we've started carrying a...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2080)
[Related Guides to the Product](https://learn.adafruit.com/products/2080/guides)
![Filament for 3D printers in various colors and types stacked together.](https://cdn-shop.adafruit.com/640x480/2080-07.jpg)

### Rotary Encoder + Extras

[Rotary Encoder + Extras](https://www.adafruit.com/product/377)
This rotary encoder is the best of the best, it's a high-quality 24-pulse encoder, with detents and a nice feel. It is panel mountable for placement in a box, or you can plug it into a breadboard (just cut/bend the two mechanical side tabs.) We also include a nice soft-touch knob with an...

In Stock
[Buy Now](https://www.adafruit.com/product/377)
[Related Guides to the Product](https://learn.adafruit.com/products/377/guides)
![Rotary Encoder with rubbery knob](https://cdn-shop.adafruit.com/640x480/377-02.jpg)

# CircuitPython Media Dial

## Circuit Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/050/715/medium800/3d_printing_circuit-diagram.jpg?1517935509)

## Trinket Ground Extension

&nbsp;

The Trinket only has one ground pin. Add more grounds with the help of a flex perma-proto.

&nbsp;

Cut a piece with four connections on a continuous rail to fit the three ground connections need for each component.

![3d_printing_flex-perma-cut.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/718/medium640/3d_printing_flex-perma-cut.jpg?1517935523)

Take a moment to review the components in the circuit diagram. This illustration is meant for&nbsp;referencing wired connections - The length of wire,&nbsp;position and size of components are not exact.&nbsp;

&nbsp;

The **NeoPixel Ring** will connect to Trinket M0. Measure **90mm** of wire for power, ground and data in.  
**Data IN** connects to pin **1** on the Trinket  
**Ground** connects to **GND** &nbsp;on the Trinket  
**5v** connects to **USB** on the Trinket

&nbsp;

The **Rotary Encoder** &nbsp;connects to the Trinket with **80mm long wires** for all of it's connections.&nbsp;

## Three pin side:

**Middle** connects to ground on the Trinket  
**Top** &nbsp; **pin** connects to **pin 3** on the Trinket  
**Bottom pin** connects to&nbsp; **pin 4** on the Trinket

&nbsp;

## Two pin side:

**Top pin** connects to **GND** on the Trinket  
**Bottom**  **pin** connects to&nbsp; **pin 2** on the Trinket

&nbsp;

&nbsp;

&nbsp;&nbsp;

# CircuitPython Media Dial

## Code

## Setup Adafruit Trinket M0 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 NeoPixel will turn green. The board will then show up as a USB&nbsp;storage device on your computer named "TRINKETBOOT".&nbsp;

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

[Adafruit Trinket M0 CircuitPython Installation Guide](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/circuitpython)
# Download Adafruit CircuitPython Library Bundle

In order to run the code, we'll need to download some libraries. The download linked below will contain all the libraries available for Circuit Python. To run the code for this project, we only need a few. Unzip the downloaded file and look for the following libraries.

## Required Libraries&nbsp;

- Adafruit Neopixel – neopixel.mpy
- Adafruit HID –&nbsp;adafruit\_hid

[Adafruit CircuitPython Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20180206/adafruit-circuitpython-bundle-2.2.1-mpy-20180206.zip)
## Install Circuit Python Libraries&nbsp;

Now that we have all of the libraries and know which ones this project needs, we'll need to copy them onto the Trinket M0 USB drive (which will be named CIRCUITPY after flashing the firmware). In the CIRCUITPY drive, create a new folder and name it "lib". Then, copy the libraries to that "lib" folder. The lib folder should contain **neopixel.mpy&nbsp;** and&nbsp; **adafruit\_hid**.

## Upload Code

OK, now it's time to upload the code for this project onto the CIRCUITPY drive. Create a new text document using a text app. Then, copy the code below and paste it into that newly created text document. Save that text document to the CIRCUITPY drive and name it " **main.py**". Once saved, the code will automatically run and will start working.

## Modify Key Codes

You can customize the key codes to form custom commands which can be multiple keys or have it execute just single keyboard characters.

The rotary encode can execute up to 3 different commands. Pressing the knob and turning the knob left or right. These are commented in the code and can be changed by adjusting the key code value.

## List of USB HID Keycodes

The long list of available keyboard characters are listed in the webpage linked below. Most of the characters are for USA keyboard only. Function keys and modifiers can be used but only some special characters are not supported.

[USB HID Keycode List Cheatsheet](http://circuitpython.readthedocs.io/projects/hid/en/latest/api.html#adafruit-hid-keycode-keycode)
Starting with the first command, turning the knob to the right, will execute the ctrl+up arrow keys. These are two different keyboard characters that are separated with commas. This will essentially press the two keys simultaneously. The values inside the parentheses kbd.press( **keycode.THISKEY** ) are the ones you want to change. For example, the block of code below is executed when turning the knob to the right.

`# Check if rotary encoder went up if encoder_direction == 1: kbd.press(Keycode.CONTROL, Keycode.UP_ARROW) kbd.release_all()`

For more information and trouble shooting, please check out the Circuit Python library guide, linked below.&nbsp;

[CircuitPython Library Guide](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries)
```python
"""
A CircuitPython 'multimedia' dial demo
Uses a Trinket M0 + Rotary Encoder -&gt; HID keyboard out with neopixel ring
"""
 
import time
from digitalio import *
from board import *
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
import neopixel
import usb_hid
 
DOT_COLOR = 0xFF0000              # set to your favorite webhex color
PRESSED_DOT_COLOR = 0x008080      # set to your second-favorite color
LIT_TIMEOUT = 15                  # after n seconds, turn off ring

# NeoPixel LED ring on pin D1
# Ring code will auto-adjust if not 16 so change to any value!
ring = neopixel.NeoPixel(D1, 16, brightness=0.2)
dot_location = 0  # what dot is currently lit

# Encoder button is a digital input with pullup on D2
button = DigitalInOut(D2)
button.direction = Direction.INPUT
button.pull = Pull.UP

# Rotary encoder inputs with pullup on D3 &amp; D4
rot_a = DigitalInOut(D3)
rot_a.direction = Direction.INPUT
rot_a.pull = Pull.UP
rot_b = DigitalInOut(D4)
rot_b.direction = Direction.INPUT
rot_b.pull = Pull.UP

# Used to do HID output, see below
kbd = Keyboard(usb_hid.devices)

# time keeper, so we know when to turn off the LED
timestamp = time.monotonic()

######################### MAIN LOOP ##############################

# the counter counts up and down, it can roll over! 16-bit value
encoder_counter = 0
# direction tells you the last tick which way it went
encoder_direction = 0

# constants to help us track what edge is what
A_POSITION = 0
B_POSITION = 1
UNKNOWN_POSITION = -1  # initial state so we know if something went wrong

rising_edge = falling_edge = UNKNOWN_POSITION

# get initial/prev state and store at beginning
last_button = button.value
rotary_prev_state = [rot_a.value, rot_b.value]

while True:
    # reset encoder and wait for the next turn
    encoder_direction = 0

    # take a 'snapshot' of the rotary encoder state at this time
    rotary_curr_state = [rot_a.value, rot_b.value]

    if rotary_curr_state != rotary_prev_state:
        #print("Changed")
        if rotary_prev_state == [True, True]:
            # we caught the first falling edge!
            if not rotary_curr_state[A_POSITION]:
                #print("Falling A")
                falling_edge = A_POSITION
            elif not rotary_curr_state[B_POSITION]:
                #print("Falling B")
                falling_edge = B_POSITION
            else:
                # uhh something went deeply wrong, lets start over
                continue

        if rotary_curr_state == [True, True]:
            # Ok we hit the final rising edge
            if not rotary_prev_state[B_POSITION]:
                rising_edge = B_POSITION
                # print("Rising B")
            elif not rotary_prev_state[A_POSITION]:
                rising_edge = A_POSITION
                # print("Rising A")
            else:
                # uhh something went deeply wrong, lets start over
                continue

            # check first and last edge
            if (rising_edge == A_POSITION) and (falling_edge == B_POSITION):
                encoder_counter -= 1
                encoder_direction = -1
                print("%d dec" % encoder_counter)
            elif (rising_edge == B_POSITION) and (falling_edge == A_POSITION):
                encoder_counter += 1
                encoder_direction = 1
                print("%d inc" % encoder_counter)
            else:
                # (shrug) something didn't work out, oh well!
                encoder_direction = 0

            # reset our edge tracking
            rising_edge = falling_edge = UNKNOWN_POSITION

    rotary_prev_state = rotary_curr_state

    # Check if rotary encoder went up
    if encoder_direction == 1:
        kbd.press(Keycode.CONTROL, Keycode.UP_ARROW)
        kbd.release_all()

    # Check if rotary encoder went down
    if encoder_direction == -1:
        kbd.press(Keycode.CONTROL, Keycode.DOWN_ARROW)
        kbd.release_all()

    # Button was 'just pressed'
    if (not button.value) and last_button:
        print("Button pressed!")
        kbd.press(44) #Keycode.SPACE
        kbd.release_all()
        ring[dot_location] = PRESSED_DOT_COLOR # show it was pressed on ring
        timestamp = time.monotonic()        # something happened!
    elif button.value and (not last_button):
        print("Button Released!")
        # kbd.press(Keycode.SHIFT, Keycode.SIX)
        # kbd.release_all()
        ring[dot_location] = DOT_COLOR      # show it was released on ring
        timestamp = time.monotonic()        # something happened!
    last_button = button.value

    if encoder_direction != 0:
        timestamp = time.monotonic()        # something happened!
        # spin neopixel LED around!
        previous_location = dot_location
        dot_location += encoder_direction   # move dot in the direction
        dot_location += len(ring)           # in case we moved negative, wrap around
        dot_location %= len(ring)
        if button.value:
            ring[dot_location] = DOT_COLOR  # turn on new dot
        else:
            ring[dot_location] = PRESSED_DOT_COLOR # turn on new dot
        ring[previous_location] = 0         # turn off previous dot

    if time.monotonic() &gt; timestamp + LIT_TIMEOUT:
        ring[dot_location] = 0   # turn off ring light temporarily
```

# CircuitPython Media Dial

## 3D Printing

![](https://cdn-learn.adafruit.com/assets/assets/000/050/730/medium800/3d_printing_3d-part.jpg?1517935598)

The 3D printed parts are fairly easy to make with most common home desktop 3D printers that are&nbsp;on the market.

And if you don’t have access a 3D printer, you can order our parts by visiting our Thingiverse page and have someone local 3D print the parts and ship them to you.&nbsp;

We designed the enclosure in Autodesk Fusion 360. The case houses the electronics while the top and bottom parts will snap fit together.

&nbsp;

We split the cover into individual pieces for 3D printing with a Dual Extruder.

&nbsp;

The inner ring is printed in translucent material so the NeoPixel LEDs can shine through the top. To 3D print the enclosure, we used an Ultimaker 3 and slice the parts in Ultimakers CURA.

![3d_printing_cad-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/728/medium640/3d_printing_cad-parts.jpg?1517935586)

![3d_printing_cad-inspect.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/729/medium640/3d_printing_cad-inspect.jpg?1517935591)

[Download Fusion360 files](https://a360.co/3Uvp4BU)
[Download from Thingiverse](https://www.thingiverse.com/thing:2784844)
[Download from Youmagine](https://www.youmagine.com/designs/circuitpython-media-dail)
[Download from Pinshape](Enter%20a%20Link)
## Slice Settings

&nbsp;

Download the STL files and import them into your&nbsp;3D printing slicing software. You'll need to adjust your settings accordingly if you're using material different than PLA.

&nbsp;

- 210C Extruder Temp
- 65c heated bed
- 1.0&nbsp;Extrusion Multiplier
- .4mm Nozzle
- 0.38 Extrusion Width
- .2mm Layer Height
- 30% infill
- No&nbsp;Supports
- skirt
- 60mm/s&nbsp;| 120mm travel speed

![3d_printing_cad-merged.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/722/medium640/3d_printing_cad-merged.jpg?1517935562)

## Dual Colors

&nbsp;

We included a dual color version of the knob cover to allow the NeoPixel ring to diffuse it. Use your preferred slicer to align and combine all three parts that make up the individual parts of the knob. Use transparent filament to allow the led lights to diffuse the knob cover.&nbsp; &nbsp;

![3d_printing_cad-merge.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/723/medium640/3d_printing_cad-merge.jpg?1517935563)

# CircuitPython Media Dial

## Assemble

## Prep Trinket M0

&nbsp;

To assemble the circuit we used a flexible PCB to extend the ground connections.This way we can break out more pins on the Trinket M0.

&nbsp;

Use sharp scissors to cut a small piece of four connected pins. The first pin on the flex PCB is soldered to the GND pin on the Trinket. The other three pins will be used for the NeoPixel Ring and Rotary encoder.

&nbsp;

Tin the GND pin on the Trinket and then using tweezers, hold the flex PCB over the GND pin while apply heated to solder the Flex PCB to the Trinket.

![3d_printing_flex-perma-cut.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/739/medium640/3d_printing_flex-perma-cut.jpg?1517935621)

![3d_printing_ground-extend-soldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/740/medium640/3d_printing_ground-extend-soldered.jpg?1517935636)

## Prep wires

&nbsp;

Next we'll move on to measuring, cutting and tinning all of the wires needed to connect all of the components together.&nbsp;

&nbsp;

The **NeoPixel Ring** will need all of the connections to be **90mm** long. The R **otary Encoder** wires need to be **80mm** long to reach the Trinket.

&nbsp;

![3d_printing_wires-cut.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/742/medium640/3d_printing_wires-cut.jpg?1517935646)

![3d_printing_wire-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/743/medium640/3d_printing_wire-tin.jpg?1517935650)

## Solder NeoPixel Ring

&nbsp;

Use third helping hands to hold the NeoPixel ring while tinning and soldering wires to the Data IN, 5v and Ground pins.

![3d_printing_ring-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/746/medium640/3d_printing_ring-solder.jpg?1517935667)

## Thread Ring wires

&nbsp;

Align the NeoPixel ring over the mounting area on the&nbsp; **dial-mid** part and pass each wire through the holes on the part.

&nbsp;

Use tweezers to help thread the wires through the holes.&nbsp;

&nbsp;

Gently press down on the NeoPixel Ring to snap fit inside the mount on the enclosure.

&nbsp;

You can use the other two free holes to push the ring out of the enclosure if you ever need to.

![3d_printing_ring-wire-thread.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/750/medium640/3d_printing_ring-wire-thread.jpg?1517935697)

![3d_printing_ring-wires-throu-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/751/medium640/3d_printing_ring-wires-throu-case.jpg?1517935701)

![3d_printing_ring-wire-threading.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/752/medium640/3d_printing_ring-wire-threading.jpg?1517935704)

![3d_printing_ring-mountB.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/753/medium640/3d_printing_ring-mountB.jpg?1517935713)

## Solder Rotary

&nbsp;

Now we can prepare the Rotary Encoder. First, gently bend the legs back to avoid making contact with the Trinket once mounted inside the enclosure.

&nbsp;

Tin and then solder each colored coded wire to according to the circuit diagram.&nbsp;

&nbsp;

You can hold the Rotary Encoder by the stem with a third helping hands to make it easier to solder.&nbsp;

![3d_printing_knob-pins-bend.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/754/medium640/3d_printing_knob-pins-bend.jpg?1517935723)

![3d_printing_knob-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/755/medium640/3d_printing_knob-solder.jpg?1517935732)

## Mount Rotary Encoder

&nbsp;

The rotary encoder is fitted through the hole on the **dial-mid** part. Rotate the part until the legs are aligned with the USB port on the side of the enclosure as shown in the picture.

&nbsp;

If you haven't already, gently ned the legs back so they don't make contact with the Trinket once mounted in place.

![3d_printing_knob-washered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/757/medium640/3d_printing_knob-washered.jpg?1517935736)

![3d_printing_knob-pin-bend.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/759/medium640/3d_printing_knob-pin-bend.jpg?1517935754)

## Attach washer

&nbsp;

Now we can place the washer and screw back on to the Rotary Encoder. Hold it in place while screwing the hex nut back onto the steam.

![3d_printing_knob-washer.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/762/medium640/3d_printing_knob-washer.jpg?1517935761)

## Solder Rotary to Trinket

&nbsp;

With the Rotary mounted we can finally move on to connect it to the Trinket.

&nbsp;

Align the Rotary assembly next to the Trinket with a pair of third helping hands.

&nbsp;

Reference the circuit diagram and solder each connection for the NeoPixel ring and Rotary to the Trinket M0.&nbsp;

![3d_printing_trinket-solder-hold.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/763/medium640/3d_printing_trinket-solder-hold.jpg?1517935764)

![3d_printing_trinket-soldred.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/764/medium640/3d_printing_trinket-soldred.jpg?1517935774)

## Mount Trinket

&nbsp;

Now we can mount the Trinket to the **dial-lid** part. We'll use **M2.5x5mm** long screws to securely mount the Trinket.&nbsp;&nbsp;

&nbsp;

First, we'll create threads for the mounts by fastening the screws to before mounting the Trinket.&nbsp; Make sure the screws fasten straight to properly align the Trinket mounting holes.

![3d_printing_tap-mounts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/770/medium640/3d_printing_tap-mounts.jpg?1517935861)

![3d_printing_trinket-mounting.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/771/medium640/3d_printing_trinket-mounting.jpg?1517935868)

![](https://cdn-learn.adafruit.com/assets/assets/000/050/780/medium800/3d_printing_kapton-wires.jpg?1517978790)

## Wire Manegement&nbsp;

Some heat shrink tubing or kapton tape can be used to keep the wires nice and tidy.

## Align USB port

&nbsp;

Now we can attach the Trinket to to rest of the enclosure. Snap fit the **dial-lid** &nbsp;onto the **dial-mid** by attaching it an angle.&nbsp;

&nbsp;

Insert the back side of the lid (opposite side of the USB opening) first and then rotate the lid until the USB port on the Trinket and the opening on the enclosure align.

![3d_printing_lid-adjust-loop.gif](https://cdn-learn.adafruit.com/assets/assets/000/050/773/medium640thumb/3d_printing_lid-adjust-loop.jpg?1517936245)

## Attach Dial

&nbsp;

Align the printed dial to the notch on the Rotary Encoders steam and press fit until it pushes all the way into the part.

&nbsp;

Make sure to apply even pressure to the dial to avoid any wobble on the cover while turning the dial.

&nbsp;

![3d_printing_knob-cover-attach.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/768/medium640/3d_printing_knob-cover-attach.jpg?1517935860)

![3d_printing_knob-cover-attached.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/769/medium640/3d_printing_knob-cover-attached.jpg?1517935860)

## Complete!

&nbsp;

Now we can fit our USB cable into the Trinket and setup any key strokes to assign to the media dial!&nbsp;

&nbsp;

We can additional attach rubber feet or even add tac to prevent the dial from moving while in use.&nbsp;

&nbsp;

If the LED ring lights up in the opposite direction while turning, you'll mostly likely need to swap the two wires on the three leg side of the Rotary Encoder.

![3d_printing_hero-medium-handB.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/774/medium640/3d_printing_hero-medium-handB.jpg?1517935895)

![3d_printing_hero-on-desk.jpg](https://cdn-learn.adafruit.com/assets/assets/000/050/775/medium640/3d_printing_hero-on-desk.jpg?1517935911)


## Featured Products

### Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE

[Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE](https://www.adafruit.com/product/3500)
The&nbsp;Adafruit Trinket M0 may be small, but do not be fooled by its size! It's a tiny microcontroller board, built around the Atmel ATSAMD21, a little chip with _a lot_ of power. We wanted to design a microcontroller board that was small enough to fit into any project, and low...

In Stock
[Buy Now](https://www.adafruit.com/product/3500)
[Related Guides to the Product](https://learn.adafruit.com/products/3500/guides)
### Rotary Encoder + Extras

[Rotary Encoder + Extras](https://www.adafruit.com/product/377)
This rotary encoder is the best of the best, it's a high-quality 24-pulse encoder, with detents and a nice feel. It is panel mountable for placement in a box, or you can plug it into a breadboard (just cut/bend the two mechanical side tabs.) We also include a nice soft-touch knob with an...

In Stock
[Buy Now](https://www.adafruit.com/product/377)
[Related Guides to the Product](https://learn.adafruit.com/products/377/guides)
### NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1463)
Round and round and round they go! 16 ultra bright smart LED NeoPixels are arranged in a circle with 1.75" (44.5mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1463)
[Related Guides to the Product](https://learn.adafruit.com/products/1463/guides)
### Adafruit Flex Perma-Proto - Half-sized Breadboard Flex-PCB

[Adafruit Flex Perma-Proto - Half-sized Breadboard Flex-PCB](https://www.adafruit.com/product/1518)
Make your next project super-flexy with a prototyping board that can twist and bend. We took our lovely classic perma-proto design and had it made from incredibly thin polyamide film. It's extremely bendable, and you can cut it easily with scissors. It has a bend radius of 1cm or better...

In Stock
[Buy Now](https://www.adafruit.com/product/1518)
[Related Guides to the Product](https://learn.adafruit.com/products/1518/guides)
### Silicone Cover Stranded-Core Wire - 30AWG in Various Colors

[Silicone Cover Stranded-Core Wire - 30AWG in Various Colors](https://www.adafruit.com/product/2051)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2051)
[Related Guides to the Product](https://learn.adafruit.com/products/2051/guides)
### Filament for 3D Printers in Various Colors and Types

[Filament for 3D Printers in Various Colors and Types](https://www.adafruit.com/product/2080)
Having a 3D printer without filament is sort of like having a regular printer without paper or ink. &nbsp;And while a lot of printers come with some filament there's a good chance you've been printing up a storm and need something new. &nbsp;That's why we've started carrying a...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2080)
[Related Guides to the Product](https://learn.adafruit.com/products/2080/guides)
### Ultimaker 3 - 3D Printer

[Ultimaker 3 - 3D Printer](https://www.adafruit.com/product/3300)
The **Ultimaker 3** &nbsp;is one of our favorite 3D printers on the market. It's a well-built open-source compact machine with an excellent UX.&nbsp;Every inch of the Ultimaker 3&nbsp;is designed to create the most effortless and reliable 3D printing experience ever!&nbsp;<a...></a...>

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

## Related Guides

- [Adafruit Trinket M0](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino.md)
- [NeoPixel Ring Lamp](https://learn.adafruit.com/neopixel-ring-lamp.md)
- [3D Printed NeoPixel Ring Hair Dress](https://learn.adafruit.com/neopixel-ring-hair-dress.md)
- [STEAM-Punk Goggles](https://learn.adafruit.com/steam-punk-goggles.md)
- [GEMMA Hoop Earrings](https://learn.adafruit.com/gemma-hoop-earrings.md)
- [NeoPixel LED Necklace Insert with USB Charging](https://learn.adafruit.com/neopixel-led-necklace-insert-with-usb-charging.md)
- [Storage humidity and temperature monitor](https://learn.adafruit.com/storage-humidity-and-temperature-monitor.md)
- [CircuitPython 101: Basic Builtin Data Structures](https://learn.adafruit.com/basic-datastructures-in-circuitpython.md)
- [Zelda Guardian Robot Terrako Companion](https://learn.adafruit.com/terrako.md)
- [CircuitPython Essentials](https://learn.adafruit.com/circuitpython-essentials.md)
- [Trinket NeoPixel LED Longboard](https://learn.adafruit.com/trinket-neopixel-led-longboard.md)
- [CircuitPython Hardware: PCA9685 PWM & Servo Driver](https://learn.adafruit.com/micropython-hardware-pca9685-pwm-and-servo-driver.md)
- [Trinket / Gemma Blinky Eyes](https://learn.adafruit.com/trinket-gemma-blinky-eyes.md)
- [FLORA NeoGeo Watch](https://learn.adafruit.com/flora-geo-watch.md)
- [USB Foot Switch Controller in CircuitPython](https://learn.adafruit.com/usb-foot-switch-circuit-python.md)
- [3D Printed NeoPixel LED Gas Mask](https://learn.adafruit.com/3d-printed-el-wire-laser-neopixel-led-gas-mask.md)
