Main > Raspberry Pi & Dev Board

Mounted Guns and Arduino mouse mapping

(1/3) > >>

syntax_x:
I recently purchased an arcade cabinet that has those mounted type guns.
They are basically just 2x10k pots and a switch for the trigger.

I wanted to interface them with an Arduino to a mame PC to play a heap of different games.
In mame I would map it to the mouse.

My problem is all the code i have found so far accelerates the cursor depending on xy values. This causes the gun to drift and is not how it should play.

I need to find a way to map out the corners of my screen and calibrate a centre, so xy values = a specific screen position.

Any pointers??

PL1:

--- Quote from: syntax_x on July 30, 2019, 12:29:03 am ---I recently purchased an arcade cabinet that has those mounted type guns.
They are basically just 2x10k pots and a switch for the trigger.

--- End quote ---
They are commonly referred to as postional guns.


--- Quote from: syntax_x on July 30, 2019, 12:29:03 am ---I wanted to interface them with an Arduino to a mame PC to play a heap of different games.
In mame I would map it to the mouse.

My problem is all the code i have found so far accelerates the cursor depending on xy values. This causes the gun to drift and is not how it should play.

--- End quote ---
A postional gun is an analog joystick, not a mouse.

You need a gamepad+analog joystick (USB/HID Joypad) sketch or firmware.

The KADE miniArcade 2.0 firmware can handle 4 analog axes (X-axis and Y-axis for each gun) and 13 gamepad buttons on a single Pro Micro board.
- Step-by-step configuration directions are in the User Guide PDF.



Once you get the Aduino programmed and wired:

1. Calibrate the analog axes in Windows Control Panel
- Devices and Printers
- Right-click on the KADE icon, "Game Controller Settings" menu item
- Properties button on the popup window
- Settings tab, "Calibrate..." button

2. Map the analog axes in MAME. (Joy 1 X Axis, etc)
- Set the "Inc" and "Dec" inputs to "none" (press Enter then Esc)

3. Check each game to see if there is a calibration menu for the guns. (press F2 for service menu)
- With some games like Star Wars you need to trace a few laps around the outer perimeter of the screen (use the full range of motion) to calibrate it.


Scott

syntax_x:
Scott I cannot thank you enough for such an in depth response.

Thanks for putting me on the straight and narrow mate :)

PL1:
Always glad to assist.   :cheers:


Scott

syntax_x:
Im having trouble flashing to a Pro Micro the same as you have pictured.

In the mapper i get

Erasing flash...

dfu-programmer: no device present.

Error. Exit code: 1


And if i try avrdude command line i get

c:\avrdude>avrdude -p atmega32u4 -P COM5 -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.hex -C avrdude.conf

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

Navigation

[0] Message Index

[#] Next page

Go to full version