Arduino Leonardo as HID for PiMAME
  • Hey all. Just finishing up my version of the IKEA coffee table hack to make an arcade console. I am using an Arduino Leonardo to convert joystick and button presses to their keyboard equivalents as well as to deal with watching for coins in my coin detector. While everything seems OK while in Linux, i.e. the joystick can actually be used to scroll through the options on bootup, nothing works in MAME. The keyboard I keep plugged in does work, however. I gather that MAME is picky about the HID it's watching, but am not sure how to work around this. Thanks in advance for your help.

    Mike
  • It may be the problem i ran into. If you have 2 keyboards, (and advmenu will think that the Arduino is a second keyboard), it assigns the second keyboard to player 2.

    See my post in this thread:

    http://pimame.org/forum/discussion/30/pimame-and-ipac2#Item_4

    for how I got around that.

    Jim
  • @mftkoehler did this solve your problem?
  • This absolutely did fix my issue. I've added some Konami-style codes to have the Leonardo issue commands to shut down the Pi and so on, and have eliminated the keyboard altogether.
  • I should clarify. JimD pointed out that the Pi doesn't deal well with 2 keyboards. That was my problem. When I went down to one, everything was fine. I didn't need to change any of the key configuration options he mentioned in his earlier thread since the Leonardo is completely customizable in that regard, so I just made it emulate the standard player 1 controls.

    Mike
  • @mftkoehler : how did you get rid of bounces ? Did you use some capacitors connected to the buttons or did you use some kind of Arduino code ?

    H_D

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!