RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    mechanical switch to insert credits

    Scheduled Pinned Locked Moved Ideas and Development
    2 Posts 2 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mrcola
      last edited by

      Hi, I am not going to use retro pie in any commercial sites or situations but planning to add another layer of fun...

      When I was playing Neo Geo emulators on PC before, I could map a key on the keypad to "insert coins", is it possible to connect a mechanical switch as shown below to the GPIO, when it is physically triggered, a credit will be "inserted" to the emulated game. If so, how can I do it?

      Thanks in advance
      alt text

      rbakerR 1 Reply Last reply Reply Quote 0
      • rbakerR
        rbaker @mrcola
        last edited by

        @mrcola They are available from here. The system will generate a certain logic level for a coin insert depending on how you power it. This is equivalent to having a key press. With buttons, you have your common ground chain so when you press a button the switch effectively pulls the input to the controller down to 0V. With your own design for this, you may use the normally open or normally closed contacts depending on your design. By this I mean, you may want a logic 1, +5V to be fed into your controller (whatever it is) as opposed to a logic 0, 0V. Your problems will be connecting to the Pi GPIO. I am using a USB decoder (ipac2) for my button presses, so if I wanted a coin mech, I'd just wire it up to my chosen SELECT input (or keep the button for exiting and choose a spare) for the INSERT COIN feature. No need for GPIO. I'll assume though that you are using the GPIO for all your controller needs? If so, you would choose the GPIO pin that is currently used for SELECT.

        If you look at this package, it is a driver for using the GPIO pins. You would use GPIO 9 in this example.

        Also, look at http://blog.petrockblock.com/gadgets/controlblock-power-switch-game-controllers-and-io-for-the-raspberry-pi/ because this will allow you to do something similar.

        Finally, If you read this, it's got a really nice tutorial on how to program the GPIO for arcade controls.

        You will need to post more information about your setup before I can suggest further reading.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post

        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.