I recently purchased an arcade cabinet that has those mounted type guns.
They are basically just 2x10k pots and a switch for the trigger.
They are commonly referred to as postional guns.
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.
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