Having built a couple joysticks and devices since then, it seemed about time to revisit the first joystick I made: the PC/SNES stick. My original stick still works well, but there were a few minor issues that started adding up:
- No direct support for XInput games or games with limited controller compatibility
- I accidentally used 25 mm action buttons and would have preferred the full-size 30 mm buttons.
- The box I picked is a bit higher than I would like
And then a bunch of minor wishlist items that started coming up (pinball buttons!) while I was thinking more about it. So I started planning and found the MSF-XINPUT library by Zack Littell, which then directed my attention to the Teensy LC. This also informed my use of the Teensy 2.0 on the previous project, as both were planned concurrently. I also still wanted SNES-compatibility, but the Teensy uses 3.3V logic while the SNES uses 5 V logic. So this also meant a line-level converter, but I conveniently already had a 4-channel one from Adafruit. Beyond that, it was just a matter of finding a suitably-sized box, and ordering a bunch of arcade parts including my current favourite stick, the Seimistu LS-40.
Having issues with placement on some older designs, I spent a bit more time with QCad doing both top and side views to ensure I wasn't going to run into space problems. Part of this planning process resulted in me moving the start/select buttons to the front of the stick to avoid cluttering the top and resulting in accidental actuation with my palm or something. The pinball buttons were originally planned to be towards the back (seen in the top view), but on further planning I moved them closer to the front instead (in the left/right views). Maybe I should look into open-source 3D CAD for future projects...
Beyond that, it was just a matter of drilling out a bunch of holes and inserting the components in the correct places. Oh, and lots of wiring, including directly soldering the wires to the Teensy rather than install pins and a needless prototype board. Extra non-standard buttons beyond the primary action and pinball buttons were added to trigger the Teensy's download feature, as well as allow switchable joystick layouts. And since cutting out DSub connectors is annoying, the SNES cable uses a DIN port this time. Here's the wiring for the stick:
It would have been helpful to have the proper sized quick connects for the toggle switches/buttons and the DIN leads, but the connectors were easy enough to solder directly to. Boards were affixed using the same mounting tape I used in the previous project, though it needed to be a couple pieces deep in some places to elevate the boards sufficiently. Wiring looks like a bit of a mess (especially with only two colours of wire for most components), but the cable ties helped keep things under control. Here's how it looks all closed up:
Programming was reasonably straightforward, though I modularized the functionality quite a bit more than the previous project. The inputs are first collected and stored in a ArcadeStick class with generic color/position based names, then mapped and updated for XInput and SNES use with appropriate mapper classes. Check out the GitHub project page for more information and source code.