JongTroller Tutorial: How to build your own lewd batton

A place where you can chat about anything that isn't to do with games!
Post Reply
User avatar
nasty_wolverine
Posts: 1371
Joined: Sun Oct 09, 2011 11:44 pm

JongTroller Tutorial: How to build your own lewd batton

Post by nasty_wolverine »

Image


By popular request by some lewd enthusiast shmup/jong farmers, I am posting how to build your own Mahjong Controller. It uses a teensy board as its controller, which is versatile enough to use the same to build a arcade stick with custom auto fire, or a IIDX/Beatmania or even a midi controller. This post will focus on the jongtroller, but with a little basic programming knowledge you can transform it into anything else you want.


Things required:
- a teensy board (i recommend 2.0 since its cheap with 24 I/O pins, get one with pins attached if you cant do fine solder)
- buttons (push momentary kind, sanwa OBSF-30 will do fine)
- bunch of wires or connections
- soldering iron, solder wire, tweezers, wire cutters


Step 1 MOUNTING
I am not going to go too much in detail on this one. You might have your own ideas of what design, buttons or layouts you want. Just build something that can take a bit of a pounding, and some way to secure the teensy board so it doesnt move around and cause wires to break. I suggest draw out the layout first, think of what you want in the controller and how you want it to look. Mines built from a Converse shoebox :P

Step 2 WIRING

This is where you will need to learn to solder. If you dont know to solder buy a board with pin stands. Like this one. The ones with pins are more expensive. Then you can use Arduino jumper wires for directly connecting to the teensy board. If you know how to solder and are confident in your abilities, you can solder directly to the board like it did. It does get busy, be careful not to damage the pcb prints.

How the buttons are wired: (dont look at the extra holes at the bottom, they were a failed attempt at hole making)
Image

How the teensy is wired:
Image

Teensy 2.0 pin layout.
Image

The basic gist of the wiring is, all buttons share a common ground. In the first picture, its the top row pins on the buttons. They are all daisy chained to the bottom GND connection on the Teensy diagram. The bottom row of the buttons are wired individually to pins 0 to 21 on the teensy board. So, all buttons share a common ground, then are individually linked to pins 0 till 21 on the teensy.

Step 3 PROGRAMMING THE TEENSY
This is the easiest step. You need two different installers, one is the Arduino dev software and the other is the teensy compat software. The teensy installs on top of the Arduino software, it adds teensy libs to the arduino software. The teensy libs are only compatible with certain versions of Arduino dev software. Get the teensy dev software here and download the Arduino dev program, you need version 1.6.13 for the as of this date version of the teensy program.

This is to compile the program that needs to be loaded on to the teensy. This is the program you need to compile and load into the teensy for a 21 button controller. Follow this guide how to setup for a joystick. Basically, select open the arduino IDE and open the supplied program file and then select Tools > USB Type > "Keyboard + Mouse + Joystick". Also select Tools > Board > your version of teensy.

The teensy 2.0 is setup to a bunch of slider, analogs and buttons. Its in the guide above. You can just program the buttons you need, the rest will show up blank. IF you decide the change that and only show the things you need then look at this post. Its a lot more hard work than you might be up for.

The supplied program, uses bounce, basically it checks for hysteresis. That means it only turns on the button when its been pressed for more than 10ms, which is less than 16ms which is one frame, so you should be fine. You can try and reduce it. The rising and falling edge is described in the code.

For windows users, Teensyduino uses a graphical program to upload the compiled hex onto the teensy board called the teensyloader. Its usually installed along with teensyduino over the arduino IDE. Sometimes it will not detect teensy at all. In such cases you will have to use the commandline version. That works fine.


And thats it, once that done, you should see teensy show up as a joystick. So first mount the components, then wire the teensy and buttons, then re program the teensy and you are done. If you have any questions or suggestions let me know. You can catch me hanging around discord or irc chat.

Things that can be done more with this. You can set up an arcade stick, you can wire and program the stick to be either analog joystick or POV hat with flip switch. You can add in a potentiometer and set up autofire rate per button. you can do anything with it really. Have fun :D
Elysian Door - Naraka (my WIP PC STG) in development hell for the moment
User avatar
Pixel_Outlaw
Posts: 2646
Joined: Sun Mar 26, 2006 3:27 am

Re: JongTroller Tutorial: How to build your own lewd batton

Post by Pixel_Outlaw »

I'd been thinking about using a teensy for a stick myself for some time.
I did use one to emulate a usb keyboard for my Emacs alt and esc foot pedals.

Looks like you've used BBQ ignition buttons?
I'd been eyeing them for the next project, obviously much cheaper than Sanwa for the non face buttons can get a set of 3-5 on eBay for quite cheap.
But how do they play as standard face buttons?

It's nice that the teensy has so many soldering points.
Otherwise you'd have to multiplex with a shift register or two.

I'm always needing to remap my joystick buttons for various systems and games.
I'd probably put a screw wire terminal between the buttons and micro controller so they can be set easily.

Nice to see more creativity than people just printing cover art for plastic sticks and swapping parts out.
Anyone can do that sort of thing.
Some of the best shmups don't actually end in a vowel.
No, this game is not Space Invaders.
User avatar
nasty_wolverine
Posts: 1371
Joined: Sun Oct 09, 2011 11:44 pm

Re: JongTroller Tutorial: How to build your own lewd batton

Post by nasty_wolverine »

i dont know if they are BBQ ignition buttons, but these are rated for 240v 2 Amps, so yeah these are line level buttons. I got them for like 30 for $10. They are a bit stiff, so nothing that requires fast reaction times. The teensy's were around $10, so the whole thing cost under $25 to build. I am pretty happy with it. Might change out the case with Acrylic once i get used to working with the material. Also, labels. Also, Teensy 2.0++ has like double the I/O of the one I used.
Elysian Door - Naraka (my WIP PC STG) in development hell for the moment
Post Reply