In comp.sys.raspberry-pi, Dennis Lee Bieber wrote:
> Eli the Bearded declaimed the following:
>> No, my questions are how the controllers work. The up-to-date pi MAME
>> system, Recalbox, just says buy USB controllers or use a keyboard.
>
> Would depend upon the controller type. Simple joysticks are just four
> digital switches, probably wired to be active-low, so when the stick is
I haven't taken it apart to examine or test the wiring, but I'm working
under the assumption it is wired like a traditional arcade stick: big
metal lever activates one[*] of four Cherry "micro" switches (not micro by
today's standards, but a standard industrial form-factor unchanged since
at least the 80s). This leads to easy wiring as a keyboard, even if the
grid will be seriously odd by having so little grid.
[*] Or two of four on a diagonal.
There are a bunch of the arcade style buttons, too, which are definitely
the Cherry D44 "micro" switches (or off-brand equivilent).
> centered all read HIGH. Move the stick in X or Y activates the relevant
> switch, making it read LOW.
The Cherry D44 switches I've used in the past are three conductor for NO
or NC use. (The are also good for several amps at 120V and available
with various lever attachments, so damned handy for lots of uses.)
> of X and Y switches... So four GPIO inputs per joystick (note: if the
> joystick common lead is attached to a GPIO output that is used as a
> selector, you could poll two joysticks using 4 input pins and two output
> pins -- have the output/selects in a pulled-high configuration and set the
> GPIO Low to select a joystick). Add another input for each trigger/button.
Yeah, I know I could wire straight GPIO, but I don't know if that's easy
to get working with MAME. Part of why I'm asking.
(I used GPIO and a Cherry micro switch for an alarm clock project. The
system only polls the GPIO while the alarm is ringing, waiting for a
turn-off. The Cherry switch sits in a wooden box and the entire lid of
the box is the actuator. Good for sleepy fumbling. The rest of the alarm
clock UI is controlled by a touch screen. Long story short, I have no
idea how that sort of input could be used with an off-the-shelf
program.)
> * For the R-Pi, this will require external converters as it does not have
> in-built A/D capability; whereas the BeagleBone Black has 12-bit A/D
> internal (Arduino tends to run 10-bit A/D).
Interesting.
>> I don't have the Pi for this yet, I was leaning towards a 3, but if
>> there's a good reason for another one, I could still switch.
> While Raspbian/NOOBS doesn't currently provide a 64-bit OS version, so
I was thinking more along the lines of does one have some better GPIO
/ etc, or some configuration that takes a useful shield board, rather
than 64 bit and core count.
> How this would fit within the MAME system I can't say -- perhaps by
> exposing A/D converters through kernel drivers which update entries in the
> "sys" file system?
Therein lies the rub of that approach.
Elijah
------
wrote his own GPIO library for the alarm clock
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|