Software Support > Automated Projects
12 position rotary switch > 2 keyboard encoder inputs, simple hardware solution?
BadMouth:
My next bit of tinkering is going to be a 3D printed rotary mod for Sanwa JLF and maybe JLW joysticks.
I'm using a 12 position ALPS rotary switch.
GroovyGameGear has a program for their GPWiz that converts inputs from 3 wires (+ground) to 2 possible gamepad presses which are mapped in MAME to turn left and turn right.
To get the 3 inputs, you wire the 12 tabs on the rotary switch like the attached picture.
I don't have a GPWiz. I could probably accomplish something useable with an autohotkey script, but official MAME builds don't recognize fake keyboard input. They recognize fake gamepad input, but I'd have to install fake gamepads and it's already hard enough keeping the current gamepad order straight accross multiple programs without throwing fake gamepads into the mix.
So I'm thinking maybe a hardware solution, but using something cheap like logic gates rather than a microcontroller.
The way it needs to work is:
Lets use x and y for variables (not the keys X and Y).
Last input pulled to ground = x
Currently pulled to ground = y
if x=1 & y=2, then Right (an output to the keyboard encoder pulled to ground)
if x=1 & y=3, then Left
if x=2 & y=3, then Right
if x=2 & y=1, then Left
if x=3 & y=1, then Right
if x=3 & y=2, then Left
It would also be nice if the output were only sent momentarily so that MAME doesn't see a key as being pressed all the time. Pretty sure I can figure that part out.
My question for you electronics guys is does a specific component come to mind for such an application?
EDIT: ....or should I just buy a teensy board and learn how to program it?
BadMouth:
I came across this: http://www.rototron.info/projects/rotary-interface/
A cheaper microcontroller, but still a microcontroller.
I guess if there was a solution with a handful of simple gates, some smart person would have gone that route already.
There are lots of ways to go with this. I'll probably just go with a sub $10 arduino knock-off.
I bought a full size arduino, another knock off with a ton of sensors, and book months ago.
Maybe my anti-social new years weekend can be spent learning.
PL1:
You may also want to look at the KADE source code.
The rotary firmware can be configured as either a one-joystick version or a two-joystick version in Loader.
Source code is at https://github.com/kadevice/KADE.
There is a "getting started" guide at http://kadevice.com/forum/viewtopic.php?f=22&t=413.
Jimmer has been doing some work recently with recompiling KADE firmwares for use with atmel 32u4 boards -- he may have some useful tips.
Scott
melvinbates:
I was curious as to what you ended up doing as a solution for this.
If you are still in want of one, I would like to offer helping with programming a small micro-controller such as an Attiny45 that could do what you need, depending on what you are interfacing it to all the discrete parts you should need would be a filter cap on the power line. I would be happy to donate the chip and time to do it. I'm excited to see how your DIY rotary works out and would be happy to be a part of it.
BadMouth:
--- Quote from: melvinbates on January 18, 2017, 04:12:55 pm ---I was curious as to what you ended up doing as a solution for this.
If you are still in want of one, I would like to offer helping with programming a small micro-controller such as an Attiny45 that could do what you need, depending on what you are interfacing it to all the discrete parts you should need would be a filter cap on the power line. I would be happy to donate the chip and time to do it. I'm excited to see how your DIY rotary works out and would be happy to be a part of it.
--- End quote ---
I appreciate the offer. I haven't ended up doing anything yet...still tinkering with the hardware maybe one evening every two weeks.
The rotary sticks aren't going to fit in my own cab because the CP is too shallow.
So this is more just a making it for the enjoyment of working on it thing with no real timeframe and no use for it once it's done. :lol
I just want it to exist!!!
Would using the Attiny45 get rid of the need for a custom PCB like the older microcontroller I linked to above?
I guess what I'm asking is are premade dev boards available for it that would work?
Navigation
[0] Message Index
[#] Next page
Go to full version