Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Mame Outputs and Arduino  (Read 1375 times)

0 Members and 1 Guest are viewing this topic.

white_ghost

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18
  • Last login:Today at 02:54:03 am
Mame Outputs and Arduino
« on: March 01, 2019, 04:59:30 am »
Hi all,
This post/software only concerns DIY(free) enthusiasts people.
A (very) little knowledge is needing about arduino programmation and hardware

It's a little utility for Mame : Simple Use of Mame Output.
Warning this project is only at early alpha stage and it was originally not intended to be shared, just for my personnal test/use but could be useful for some of you (or not)

This little program will allow you to retrieve the Mame outputs or Supermodel outputs such as lamp, led, digits states. Datas that you can processed on an arduino (or other hardware with serial com port) to switch on/off toys on your own system (ie : blinking start button, view buttons like in real arcade cabinet....). It's really easy to make your own arduino sketch for that (read the readme)
I add also the possibility to use motor datas with your wheel or rumble pad. However not really usefull because a few games have these sort of outputs in Mame. Furthermore, it's my own interpretation of the datas : raw datas converted to directinput, it doesn't reflect real effects

given as is, use it at your own risk ;)
tested under win 7 with arduino, g27 and xbox360 pad
no ideas if it works with other hardware

https://yadi.sk/d/K3tAthypsbfiNQ

happy DIY

othar

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:May 01, 2019, 04:35:53 pm
  • I want to build my own arcade controls!
Re: Mame Outputs and Arduino
« Reply #1 on: May 01, 2019, 03:47:44 pm »
thanks.. i was searching something like that

Eduardoml

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:November 06, 2019, 10:26:29 am
  • I want to build my own arcade controls!
Re: Mame Outputs and Arduino
« Reply #2 on: October 03, 2019, 05:20:10 pm »
Hi,
I was looking for a simple solution to use the lamps in an Offroad Challenge cab i'm converting to mame (it's hard for me to import a ledwiz into my country) and i found your post and it was just what i was looking for but i have some doubts. can I use with the Boomslang FFB Arcade plugin? Can there be some kind of conflict? Can I use the original 12volt bulbs or should I use 5volt LEDs?

Another thing is that I am struggling to understand how to create the program for Arduino, if not asking too much could you please post some real example of ino file with a simple wiring diagram so that I can better understand how to do it in my case? If you want I can help with testing on different hardware and etc.

Thanks.

white_ghost

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18
  • Last login:Today at 02:54:03 am
Re: Mame Outputs and Arduino
« Reply #3 on: October 04, 2019, 03:52:56 am »
hi,
you can use it with arcade ffb plugin if you shutoff the ffb part of my project (select "none" in the ffb device list)

you can command what ever you want with an arduino (or equivalent), it's just a question of electronic design
an arduino can drive a simple led directly (resistor+led)
you can use a transistor witch commands a simple relay for a 12v light bulb  (don't forget the bypass diode in this case)
you can use a mosfet to command a 12v light bulb
it's really easy to find schematics about that on the net

Eduardoml

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:November 06, 2019, 10:26:29 am
  • I want to build my own arcade controls!
Re: Mame Outputs and Arduino
« Reply #4 on: October 04, 2019, 01:07:30 pm »
Thanks for the help, as you suggested I used relays to turn on the 12v lamps and managed to make them work with the Arduino with some basic sketches, but as I have only very basic programming knowledge I am not able to do the Arduino sketch to use with your project, the read me tells me to do an if of the next character after L, but I don't know how to do these syntaxes and process data, etc., but I don't know what that means, I'm lost.  :dizzy:
If you can post a basic real example of ino and ini (for some example rom) files I can adapt and understand by trial and error and that would be a big help.

Thanks.

white_ghost

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18
  • Last login:Today at 02:54:03 am
Re: Mame Outputs and Arduino
« Reply #5 on: October 05, 2019, 03:15:22 am »
re,
I've sent you yesterday a skeleton sketch for arduino, you'll only need to process the datas to your outputs, read your pm
you have multiple example of ini in the archive
ie : outrun
in the ini I've assigned
Start_lamp=lamp2
Brake_lamp=lamp1

so your arduino will receive
=L001 this means Lamp number 01 is off
=L101 this means Lamp number 01 is on
=L002 this means Lamp number 02 is off
=L102 this means Lamp number 01 is on

in the sketch, datas are located in
leds : value 0 to 99 represents the led number (warning to the leds=leds-1 in the sketch)
leds_state : state of the led (0 -> off, 1 -> on)

you'll just have to make simple tests on these datas to switch on/off the right outputs of your arduino

Eduardoml

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:November 06, 2019, 10:26:29 am
  • I want to build my own arcade controls!
Re: Mame Outputs and Arduino
« Reply #6 on: October 08, 2019, 02:24:12 pm »
Sorry I did not see that you had sent me a private message, with the example file I could understand, did some tests and it worked perfectly, thank you.  :)