Pages: [1]   Go Down
Author Topic: NEED HELP ASAP - FINAL YEAR PROJECT DUE ! MAME  (Read 1160 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey guys ive been making a MAME cabinet for the past few months. Originally in order to use microswitch pushbuttons in order to replicate a keyboards buttons presses, a keywiz PCB was used.. but didnt work. I went to Jaycar electronics and asked for their advice, and was told that a arduino mega PCB will do the trick. I have a few questions
 - i have the buttons all wired to pins, and pins placed in said slots.. but in order to power the microswitches, where should i get the power from? i daisy chained all the buttons and connected one end to the 5v and the other to the GND, but the LED's on the board just turn off, which im guessing means i am shorting the circut. How should this be correctly wired?

- the coding side of this is very.. very confusing to me. Is someone able to create me a code that will allow me to have 16 buttons and 8 joystick switches giving keyboard commands (z x UP DOWN etc.)?

i know its a lot to ask for but i now have less than a week to complete this and its make or break as it contributes to 80% of my mark for the year..

also i didnt know where to post this as im new to the forums, if there is an admin that notices this and how the power to, please move this to its appropriate forum.

THANKS IN ADVANCE GUYS!
Logged

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1389
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1 provide the circuit diagram of what you've already built
2 provide the code that you've already written

then someone might just try to guide you so that YOU can do what's necessary to avoid being tagged as a cheat.
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1848
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I suspect you need to start at the beginning.  Follow the tutorial for ReadDigitalSerial (http://arduino.cc/en/Tutorial/DigitalReadSerial) to get 1 button working.  Then add 2, 3, etc.  Don't immediately try doing all 16 at once.

As a hint, you don't want to daisy chain all of the buttons connected to both 5v and ground.  Instead you want to connect all of the buttons to ground each with their own resistor, and then connect each button to a separate digital pin on the Mega.

Similarly for AnalogReadSerial (http://arduino.cc/en/Tutorial/AnalogReadSerial) to read from the joysticks.

I suspect you are going to be burning a lot of the midnight oil on this project.
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

a keywiz PCB was used.. but didnt work.
Define "didn't work"? 

You went from a solution designed specifically for what you are doing (keywiz) to a general purpose device (Arduino).  That seems like a strange change.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

CO, USA
Offline Offline
God Member
*****
Karma: 5
Posts: 711
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I suspect you need to start at the beginning.  Follow the tutorial for ReadDigitalSerial (http://arduino.cc/en/Tutorial/DigitalReadSerial) to get 1 button working.  Then add 2, 3, etc.  Don't immediately try doing all 16 at once.

There's also debouncing, which is probably important for an arcade system. Well, I'm assuming arcade, because the MAME I know about is the Multi Aracade Machine Emulator. Really cool thing for playing Galaga on my Linux box. smiley
Logged

... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1848
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There's also debouncing, which is probably important for an arcade system. Well, I'm assuming arcade, because the MAME I know about is the Multi Aracade Machine Emulator. Really cool thing for playing Galaga on my Linux box. smiley
Yes, once the OP can read digital and analog signals, then he/she needs to think about debounce (particularly for the joysticks), but it sounded like he/she was at a more basic level.  Of course the problem with doing debounce for 8 analog joysticks, is you don't want to do read, dobounce, read serially on each value, but instead you want do all of the initial reads, then the delay, and then the 2nd reads.  And when you are dealing with 24 buttons, you need to start thinking of using things like arrays.
Logged

Pages: [1]   Go Up
Jump to: