DIYArcadeControllerBuild Fin
DIYArcadeControllerBuild Fin
UNLEASH YOUR
INE
N R MAKER!
Whether you’re 8 or 80, the Maker Shed offers an incredible
array of kits for learning about electronics, engineering,
design, and coding. So what are you waiting for? Dive in and
discover a whole new universe of possibilities!
Makey bit:Mobile Kit & Getting Started Making Simple Robots Starter Pack
with the micro:bit book with kit & Making Simple Robots book
DIFFICULTY:
Easy
MATERIALS
» Box x 1
» Arcade stick x 1
» Ball Top x 1
» Dust Guard x 1
» Buttons (30mm) x 8
» Buttons (24mm) x 5
» Button Leads x 13
» USB Encoder x 1
» USB Connecting wire x 1
» Templates x 2
» Sticker x 1
TOOLS
» X-Acto Knife or Box Cutter
» Masking Tape
» Hot Glue Gun
» Screwdriver
» M4 or 8-32 bolts and nuts
(optional)
THE BUILD:
1 1. Open your kit box and unpack the contents, paint or decorate your
Tab box as desired.
cut 2. Carefully pull the interior side tabs out of the box, lay it out flat and
b
Ta
flaps
43/4" cut 43/4" off each flap (Figure A ), this will make it easier to cut out
your button and joystick holes.
A B
3. Refold the box and close the lid, then flip over to the bottom of the
box, the thumb notch should be facing away from you on the lower
side of the box.
4. Use the Makey Robot sticker or the provided paper template,
center on your box (Figure B ).
5. For the sticker, carefully peel/crack one side of the sticker and
C D align on your box. Peel remaining backing and smooth across the
box using a credit card or other flat item to remove any air bubbles
from your sticker. For the paper template use masking tape.
6. Using a sharp razor hobby knife or equivalent blade carefully cut
out the large 8 button holes and the smaller 2 button holes, cutting
inside the white dot area only. Do not cut out the joystick hole yet.
Tip: Try pie cuts with your blade or use a screwdriver or skewer
to poke holes in a radial pattern to make cutting out your circles a
E
snap! (Figures C and D ).
7. Test the fit of the buttons but don’t press any buttons all the way
in yet. If it’s a little too tight, you can carefully remove a little more
cardboard from the circumference of the hole until the button can
be pressed in snuggly. Connect the ends of each lead to the prongs
Red goes to + on each button (Figures E and F ).
8. The arcade stick can be attached in a couple of ways, for this build
Black goes to - we are going to use the screws found in the joystick itself. You can
also use hot glue or M4 bolts and nuts (or 8-32 for an imperial
F
1
DIY Arcade Controller
You might notice that you have three more buttons and cables left over
(Figure Q ). These buttons, or any of the buttons really, can be placed
wherever your heart desires. For example I found it useful to have
buttons on each side of the box for pinball games (Figure R ).
The controller is completely plug and play. When you connect it to a
Windows PC a generic gamepad driver will automatically be installed
and you can check the functionality using Windows Gamepad Setup.
If you want to use it for modern games it can be configured through
Steam’s Big Picture mode and is completely customizable. For retro
P games, MAME and most emulators will automatically recognize it.
It is also plug & play and fully configurable with Raspberry Pi, Linux
and Retropie setups. Check out our Getting Started with Raspberry Pi
book for more about retro gaming.
CODE:
//Tyler Capps
//MAKE:
//April 2023
Q R // Controlling an Arduino with an arcade style joystick and buttons
int buttonValue;
void setup() {
// put your setup code here, to run once:
pinMode( dirDown , INPUT_PULLUP);
pinMode( dirUp , INPUT_PULLUP);
pinMode( dirLeft , INPUT_PULLUP);
pinMode( dirRight , INPUT_PULLUP);
Serial.begin(9600);
void loop() {
3
// put your main code here, to run repeatedly:
DIY Arcade Controller
buttonValue = analogRead(A0); //Read the analog value from pin
NOTE: The USB encoder board that comes with the kit can take up
A0
to 12 buttons of input. The 4 inputs for CLR, AUTO, TURBO and MODE,
are state modifiers that aren’t rebindable or usable as extra button int Up = digitalRead(dirUp);
inputs. int Left = digitalRead(dirLeft);
int Right = digitalRead(dirRight);
• MODE: Switches between digital and analog mode. The joystick is not int Down = digitalRead(dirDown);
analog so this function is not useful for this build.
• TURBO: When the turbo button is held down any other button pressed
will repeat rapidly. if(Up == LOW && Left == LOW){
• AUTO: sets all buttons to turbo mode until CLR is pressed.
Serial.println( “Direction: UPLEFT”);
}
• CLR: Clears AUTO state.
else if(Up == LOW && Right == LOW){
So if you connect a button to AUTO you also need a button connected to Serial.println( “Direction: UPRIGHT”);
clear, otherwise turbo will be permanently turned on. }
else if(Down == LOW && Right == LOW){
There are also 4 extra inputs for AU, AD, AL, AR connections, but
they mirror the directional inputs from the joystick ribbon cable port. Serial.println( “Direction: DOWNRIGHT”);
Meaning you can use the ribbon cable for the joystick OR the individual }
connections, but not both. else if(Down == LOW && Left == LOW){
Serial.println( “Direction: DOWNLEFT”);
}
else if(digitalRead( dirUp ) == LOW){
Serial.println( “Direction: UP”);
}
else if(digitalRead( dirLeft ) == LOW){
Serial.println( “Direction: LEFT”);
}
else if(digitalRead( dirRight ) == LOW){
Serial.println( “Direction: RIGHT”);
}
else if (digitalRead( dirDown ) == LOW){
Serial.println( “Direction: Down”);
}
else{ //This is where you would add an action for when no
direction is pressed.
}
// The resistors in the circuit will cause different resistances to be
read for each button when pressed
// This is how the Arduino knows which specific button is being
pressed when all of the buttons are connect to a single pin
// Here is where we tell the Arduino what ranges to look for for
each button
4
TIP: Cut just inside the dotted lines. You can
always trim more out if the holes are too small.
On the go
Online