adding analog support to my barcade
-
@mitu sorry to bother you since you seem to be really clued up on everything pi input related I would like to ask a quick question. Do you know if there is any way I could hook one of these up to a pi and get it to register as a input controller so i can add an input axis. I could turn an ardunio into a hid controller if need be if its not possible. I just want to add a quick axis controller for my barcade since joysticks are digital only.
-
Well, I'm not that skilled with electronic circuitry, but that joystick could fit the bill. I noticed it says 5V, so you might need a converter instead of a full Arduino board, since the PI's GPIOs are 3.3V LL.
For the device you found, it seems there are a few tutorials already:
- https://projects-raspberry.com/using-a-joystick-on-the-raspberry-pi-using-an-mcp3008/
- https://retropie.org.uk/forum/topic/12277/how-to-set-up-mcp3008-adafruit-analog-joystick-rpi (with external links to the project).
- https://github.com/virtualbjorn/Raspberry-Pi-3-Joystick-with-MCP3008 (with an additional 'driver' for the joystick).
- RPI forum post started by the 1st tutorial link - https://www.raspberrypi.org/forums/viewtopic.php?t=144710
Of course, you might have already found the links above and based on it you found the actual device :). As I said, I'm an expert, so take this with a grain of salt - maybe others can chime in.
-
@mitu it should run just fine on 3.3v as it is. I have run tons of 5v controllers (including rapid fire controllers) at 3.3v no problem with analog sticks on them.
-
yea the voltage shouldnt be an issue i have a few of these lying about for ardunio projects from before cheers for the links!
-
The actual part of programming wiring it and reading the data isint a problem at all. The part i need help with is how to map it as joystick device. Ill read them guides in more detail thanks again
-
@grant2258 Hm, looks like creating an analog joystick might not be so straightforward. The approach in the links I gave earlier are for either reading the values or for creating a digital joystick (like the Adafruit joystick bonnet). Most of the script use Pythong to create a joystick device using the
uinput
modules.
I found one (so far) example (based on the 1st link) which seems to simulate an analog joystick with full axis movement based on the GPIO input at
https://github.com/qubecad/Pi_stick/blob/master/analog_joycestick.py (from this page). I'm sure there are other solution, more user friendly, haven't found another one yet.As for integrating into games, I think you'll be presented with a standard joystick (
/dev/input/js0
) that can be read like any other joystick -
Well i could hack code into mame2003-plus to read it thats not a good global solution though so ill add it to my todo list which isint too long atm!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.