retrogame.c and MCP23017

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rayray221
 
Posts: 1
Joined: Mon Oct 28, 2013 11:50 am

retrogame.c and MCP23017

Post by rayray221 »

Hello,

I have successfully been able to utilize the retrogame.c application to get MAME4all up and running, however I would like to add more GPIO pins to add multiple joysticks/buttons. My question is, how can I gain access to GPIO pins on a MCP23017 from within the retrogame.c application?

I'd like to try to figure this out, however I'm still learning c and really don't have a grasp on interacting with HW yet.

Any help would be greatly appreciated.
Thanks
Ray

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: retrogame.c and MCP23017

Post by adafruit_support_mike »

People who make telescopes say it's faster for a beginner to grind a 4" lens then an 8" lens than to grind an 8" lens from the start. The same is true here.

First, get reasonably comfortable with C. Then look at the C library which provides access to the GPIO pins, and probably the specific code that does I2C. Write a program that can talk to an MCP23017 at all, then do specific things like configuring a pin for input or output. Then learn how to connect the hardware like buttons and joysticks to the MCP23017, and make sure you're getting the values you want.

Once you're comfortable with that, dig into retrogame.c and look for the IO code. Figure out what will be required to add more players/controls, and how to integrate values from the MCP23017 into the IO.

I'd rate your project as intermediate/advanced level.. complex enough that giving direct technical answers would confuse a beginner more than no answer at all.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”