40-pins GPIO and joysticks
  • Hi all,

    I had been reading the Adafruit's guide to add arcade controls to GPIO. But the guide are to the old Raspberry Pi and the guide are only for one joystick with two buttons.

    Does any in here knew a newer guide for 40-pins GPIO to add two joysticks with example 4 or 6 buttons each, a coins button and a 1p/2p button? And if possible with a esc-button and a coin acceptor.
  • @KFJ1972 - It's still the same thing, you just have extra pins to use. You need to edit the retrogame.c file (near the top is an array of pins an corresponding keystrokes to send when those pins get activated) You can connect as many joysticks and buttons as you want, then just map them accordingly. I have 2 joysticks, 10 buttons. Use this image as a reference for your gpio (this is good for a+,b+,pi2) image
  • Check my github for more details https://github.com/ian57/Raspicade-Retrogame-2Player-Pi2. You ll find what you are searching with a wiring schema in the wiki.
  • Thanks to your both for the answers. I still not succes to control anything with my joysticks :-( I must do something wrong, but still work on it.

    About this part:
    $ git clone https://github.com/ian57/Raspicade-Retrogame-2Player-Pi2.git
    $ cd Raspicade-Retrogame-2Player-Pi2
    $ make

    Should line 3 not be "make retrogame" instead only "make" ?
    Because if use "make" I only got this "make: Nothing to be done for 'all'"
  • That means that there are no changes to the source since the last build (which is included)
    'make' is the same thing as 'make all', or basically build everything. Since there is only one file to build in this case, it is the same as if you had typed 'make retrogame'

    you can test it with sudo ./retrogame, then press your buttons and see if you get any output (press ctrl+c to quit)
  • Because exe is already compiled. To make yours :

    make clean && make

    will do the job
  • Ok then I better understand. I will try again later and see if I have more luck this time.

    Thanks to your both :-)
  • when i test it, i get feedback on my joystick but not my buttons. Right now I only have 2 of my 8 hooked up for testing.
  • check to make sure that your buttons are wired correctly, then make sure that the correct pins are mapped in your retrogame.c file (and that you have run 'make' if you made any changes to retrogame.c)
  • I just got an Ipac-2. Gave up on GPIO :-(

    When use the Ipac-2 my joystick, firebutton 3 and 1p-start works.

    But firebutton 1, 2 and 4 and coin doesn't work :-(
    I test all with connect the Ipac-2 to my PC and use some Ultimarc software.
    Seems like I have to remap some keys in PiPLAY. Any know where and how I do that?

    Thanks
  • in the main piplay menu, press 'tab' then go to 'controller setup' to configure your keys for each emulator.
  • I try that already.
  • are you saying that they don't work in the piplay main menu, or in the emulators?
  • I say that my joystick, firebutton 3 and 1p-start works.
    Firebutton 1, 2 and 4 doesn't work.

    If check with the Ultimarc software in Windows then everything works.
  • @KFJ1972 - Right, but do you mean that they don't work at all in piplay and the emulators?
  • Yes, the joystick, firebutton 3 and 1p-start works both in the piplay menu and in the emulators.

    Firebutton 1, 2 and 4 doesn't work anywhere, only if doubble check it in windows with the Ultimarc software. It's like piplay can't find lcrtrl, lshift and so on. Button 3 works because it's SPACE and not left something.

    Yeah sound strange, I know.
  • ahh. that's probably your problem. so, first off, you can reconfigure your ipac to send different keystrokes. You use the winipac config tool. (instructions here)

    What emulators are you trying to use? There may be an error in the formatter (each emulator requires slightly different semantics for left/right formatting)
  • Ok, I just put something else to Fire 1, 2 and 4. How I let piplay knew it? Seems like not enough to try with Tab.

    I'm use AdvanceMame.
  • If you use that winipac tool, then it reprograms your ipac to send different keyboard strokes. After that, you just need to press 'tab' and reconfigure the emulators.

Howdy, Stranger!

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