Overview
Gaming Cranks are the hot rage in handheld input devices right now. Its a great input for games and applications!
The Adafruit PyGamer is a perfect gaming device to attach a crank as an input device for games and more!
We have a great example in the Cranky Gif player!
In the Cranky Gif player demo, rotating the crank makes a gif image step through each frame of its animation. It brings back the experience of those old school Mutoscope viewers!
For this project, we designed and 3d printed an articulating hinge crank add-on for rotary encoders.
We designed a case to house the PyGamer with geometry to hold the rotary encoder in place.
You can also add custom NinjaFlex buttons and d-pads to make the buttons feel more grippy and squishy!
We'll then cover how to modify headers to make connecting to the PyGamer easier!
You can also use existing Knob parts like our Circuit Python Media Dial!
An easy to copy and paste list of parts used in this project.
Page last edited March 08, 2024
Text editor powered by tinymce.
Circuit Diagram
This provides a visual reference for wiring of the components. They aren't true to scale, just meant to be used as reference. This diagrams was created using the Fritzing software package.
Take a moment to review the components in the circuit diagram. This illustration is meant for referencing wired connections - The length of wire, position and size of components are not exact.
We measured and cut all wires to 120mm long. This will allow the wires to reach from the female headers to the rotary encoder on the opposite side of the board.
Use silicone wire to make them easier to coil and manage.
We can use right angled headers to solder to the wires or DIY your own by bending headers 90 degrees.
- Pin 9 connects to the B pin (Green wire)
- Pin 6 connects to the A pin (Blue wire)
- Pin 5 connects to the Switch pin (Yellow wire)
Ground
We used a short wire to connect one Ground to the other (Grey wires) and then added another Ground connection to the GND female header on the PyGamer.
Page last edited March 08, 2024
Text editor powered by tinymce.
Code
For a complete guide on converting your GIFs, and setting up the Arcada Libraries, follow the full Arcada Animated GIF Display tutorial below!
Page last edited March 08, 2024
Text editor powered by tinymce.
3D Printing
3D Printed Parts
The parts in this kit are designed to be 3D printed with FDM based machines. STL files are oriented to print "as is". Parts require tight tolerances that might need adjustment of slice settings. Reference the suggested settings below.
CAD Files
The fusion 360 source file is included and features original sketches and feature timeline along with easily editable user parameters. The parts can further be separated into small pieces for fitting on printers with smaller build volumes. Note: STEP file is included for other 3D surface modeling programs such as Onshape, Solidworks and Rhino.
Settings
Use these settings as reference. Values listed were used in Prusa Slicer slicing software.
- 0.2mm Layer Height / 0.4mm nozzle
- 0.38mm Line Width (inner & outer widths)
- 40mm/s printing speed
- 20% infill
- Supports: No
NinjaFlex buttons
The buttons are print in flexible material. We used NinjaFlex 85A (elastic) for a more rubbery, squishy feel. Below are some of the setting we modified in the default flexible materials profile in Prusa Slicer.
- no retraction (off)
- 30mm/s print speed
- 230c nozzle
- 55c Bed
- first layer height .25mm (avoids bonding to pei bed)
Page last edited March 08, 2024
Text editor powered by tinymce.
Assembly
Headers
To simplify the rotary connections, we used right-angle male headers to plug into the female headers on the PyGamer.
We can can also just bend spare headers. Use two Precision Flat Pliers to carefully bend the longer ends of the pins at an angle.
Solder Wires
Refer to the Circuit Diagram page to solder the wires to each terminal on the Rotary Encoder.
We measure the wires 120mm long to reach the headers on the back of the PyGamer to the right side of the enclosure.
We used two helping hands to secure the header pins and rotary while soldering each wire.
Speaker
We used the oval speaker with the short wires to mounting to allow the case to mount easier.
If you have speakers with longer wires, make sure to coil them around the speaker to avoid blocking the standoffs on the enclosure.
Remove the sticker cover on the front of the speaker (opposite side of the shiny magnet) and press in the center of the speaker outline on the back of the board.
Tac for Battery
Next we'll use a small amount of sticky tack to attach the 350mAh lipo battery to the back of the board. Gently press the battery to adhere the tac to the board.
The 350 mAh battery fits the PyGamer standard case. With this case, you can instead use a 400 mAh battery for more battery life.
Plug in Rotary Header
Align the headers to pins 5,6 and 9. Press to secure the male header into the female sockets.
Install the the single Ground header into the GND connection on the opposite header socket row.
3D Case
Tuck the wires behind the board, around the STEMMA ports and around the speaker. Align the PyGamer board to the standoffs on bottom case first.
Insert the board at an angle with the headphone jack first and then position the rotary encoder into the port on the right side of the case.
Align the top part of the case to the screen and align with the screw holes and button cutouts.
Screws
Next we'll secure the two halves of the enclosure with four M3x6mm long screws. The screw mounts are counter sunk. Carefully fasten each screw until they are below the height of the case.
Screws Covers
To add a bit of a polished look to the case, we'll print a set of matching screw caps.
Align each cap at an angle to the counter sunk holes and press fit to attach.
Add Buttons
Finally we can start to add the buttons and even switch out the d-pad for a more squishy NinjaFlex version. Align the square connectors to the the posts on the buttons.
Test alignment by making sure each button press makes a solid click.
Page last edited March 08, 2024
Text editor powered by tinymce.