Skip to content

Wiring & Firmware

danwillm edited this page Jan 8, 2021 · 3 revisions

Wiring

It is worth noting here that it is not needed to have all the components listed here if you do not plan on using them, but it is recommended if you wish to play games which require these inputs (Half-Life Alyx, for example).

Potentiometers

A slide potentiometer can be wired like so:

Many slide potentiometers have 4 pins on one end, and 2 on the other. This is so you can have two separate rails of different voltages inone potentiometer. However, for this project, we only need to use one rail.

Make sure to only solder onto one side of the potentiometer, ie. the two of the four rightmost pins on the 4 pin end, and the right of the 2 pins on the other end. The side with 2 pins should have one pin wired to ground, and 2 of the 4 pins are +ve and signal.

Attach the +ve to your 3.3v rail on the breadboard, gnd to any ground pin, and signal wires through A0->A3. Wire the potentiometers, A0 through A3 for the fingers as to go from left -> right.

You'll know if you've got the fingers the wrong way round as they will show up in the wrong order. Not an issue, simply reverse the order.

Joysticks

Joysticks have 4 or 5 outputs. If you have a joystick that has a button on it (most do), then you'll have 5 outputs. You can use this button with this project.

For wiring the button, refer to the buttons section on this page.

Attach the +ve pin to the +5v rail on the breadboard, then attach the x-axis to A4, y-axis to A5.

Buttons

The code is currently configured to use pull-down resistors (I had some ones already with resistors already on). You can choose to either solder on resistors, or refactor the arduino code to configure them as pull-up, requiring no resistors. I'm planning on refactoring the code to use pull-up resistors anyway, but I had spare buttons from a previous project with the resistors already attached, so used them and configured it as pulled-down.

If you have a joystick button, mount this to D2.

Mount the "Trigger" button to D3.

Mount the "A" button to D4.

Attach the +ve to 5v and gnd to any ground pin.

It is really up to you where you mount these buttons (if you want them at all). I mounted the joystick and A button along the edge of the index finger, and the trigger button to the palm, but I'm sure there's most likely better ideas for this.

Clone this wiki locally