element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum How to Interface Arcade Controls with the Raspberry Pi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 24 replies
  • Answers 2 answers
  • Subscribers 675 subscribers
  • Views 6622 views
  • Users 0 members are here
  • arcade_machine14
  • buttons
  • gpio
  • joystick
  • retrogaming
  • retro
  • raspberry_pi
  • raspberry-pi
  • raspberrypi
  • arcades
Related

How to Interface Arcade Controls with the Raspberry Pi

spannerspencer
spannerspencer over 10 years ago

Hi guys! As you know, we're putting together a Raspberry Pi-powered arcade machine, so we can live firmly in the past (where all the good stuff happened) and revel in the joys of retro video games!

 

Among the various challenges we're faced with in adapting our new cabinet is interfacing the controls with a Raspberry Pi, so I thought I'd ask for a few suggestions from the people in the know (that's you).

 

Joysticks & Buttons

In principle this is a very simple task, because the arcade controls are just micro-switches. They could go straight onto the GPIO pins, with a bit of cunning software running on the Pi to turn the inputs in HID keyboard presses. The emulator recognises these straight out of the box, making it a very neat and efficient way to interface the controls.

 

However, the problems arise from there not being enough GPIO inputs for the number of controls we need. So what can we do to either increase the number of inputs, or maybe even go in a totally different direction, such as converting it all to use a USB input of kind? Would love to hear some creative suggestions from you guys on the subject.

 

List of Inputs

Here's a breakdown of the number of inputs we need to get the arcade machine up and running. Each input can just be considered a simple switch -- nothing clever needed with analogue controls or the likes. This is purely on/off digital simplicity. Just a lot of them.

 

Input NumberFunction
1Player One - Left
2Player One - Right
3Player One - Up
4Player One - Down
5Player One - Button 1
6Player One - Button 2
7Player One - Button 3
8Player One - Button 4
9Player One - Button 5
10Player One - Button 6
11Player One - Start
12Player Two - Left
13Player Two - Right
14Player Two - Up
15Player Two - Down
16Player Two - Button 1
17Player Two - Button 2
18Player Two - Button 3
19Player Two - Button 4
20Player Two - Button 5
21Player Two - Button 6
22Player Two - Start
23Coin/Credit (a single input from the coin mechanism, rather than one for each player)
24Exit Game (a button to bring players out of the game, and back to the emulator)
25Select Game (for choosing a game to play from the emulator's list)
26Pause
27Spare (just in case)
28Spare
29Spare
30Spare

 

Your thoughts on a post card, please!

  • Sign in to reply
  • Cancel
Parents
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago

    going back to the switch inputs, there is no need to try to input all those switches directly into the PI, one GPIO at a time, use a few MCP23S17 (SPI) or MCP2317 (I2C) to read all inputs in one go, using the GPIO will require a seperate read for every pin, the 23S17 is 16 bits for one chip, can be in or out and is cascadeable so easy to have 32 pins read in a single SPI command, debouncing may not even be necessary really or just a simple RC network, these old games used either heavy duty micro switches or the equivilent of heavy duty relay contacts that the button or lever pushed aginst. Software debounce would be easy to do if your read, then imedialtly read again and compare the results, it need not be any more complicated than that

     

    The chips also have the option to use an interupt on any pin change if you want... easy (Relativly)

     

    Episode 187: Ben Heck’s Teensy Pinball Portable Part 1 Episode 17.5 mins in is bens pinball input board using a different chip but basically the same idea and he also did not use debounce as it was not needed

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago

    going back to the switch inputs, there is no need to try to input all those switches directly into the PI, one GPIO at a time, use a few MCP23S17 (SPI) or MCP2317 (I2C) to read all inputs in one go, using the GPIO will require a seperate read for every pin, the 23S17 is 16 bits for one chip, can be in or out and is cascadeable so easy to have 32 pins read in a single SPI command, debouncing may not even be necessary really or just a simple RC network, these old games used either heavy duty micro switches or the equivilent of heavy duty relay contacts that the button or lever pushed aginst. Software debounce would be easy to do if your read, then imedialtly read again and compare the results, it need not be any more complicated than that

     

    The chips also have the option to use an interupt on any pin change if you want... easy (Relativly)

     

    Episode 187: Ben Heck’s Teensy Pinball Portable Part 1 Episode 17.5 mins in is bens pinball input board using a different chip but basically the same idea and he also did not use debounce as it was not needed

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • mcb1
    0 mcb1 over 10 years ago in reply to Robert Peter Oakes

    It seems that a bunch of NZ students did it up north some time ago using an Arduino.

    http://www.futureintech.org.nz/enews/Industry/story.cfm?ID=14

     

    No details on how but it seems a perfect job for a micro ...

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube