2 Joystick 8 Button Controller Hook Up
-
Okay So i have 2 Joysticks
https://www.adafruit.com/product/245
And 8 buttons
I would like to hook them up by gpio and Dont know how to hook them up. Coul dI get some help? Thanks in advance. -
sorry, but it dosnt exactly work like that ...
those thombsticks will not work with the pi, without something that will read from the thumbsticks and translate the analog movement to the pi, as the gpio pins on a pi can only read 0 or 1.
maybe you can get some kind of interface that will work over i2c or perhaps usb?
edit:
something like this would work:
https://www.adafruit.com/product/1083here you can see how you need to wire it (not sure this is correct tho, but you will get the idea):
you would still need some programming to make it work tho, i doubt there is anything in retropie to support it.
-
if you dont want an extra micro controller you can just use this it will do the analog part you will need to add more code for the buttons.
http://devilqube.blogspot.com/2014/02/analog-thumbstick-and-raspberry-pi.html. I was going to add a thumbstick to my barcade might actually get round to it one day!
-
its not a microcontroller, its an adc + pga ready to use.
you are essentially suggesting the same thing, just without the pga and in a bigger package.
-
@Halvhjearne said in 2 Joystick 8 Button Controller Hook Up:
its not a microcontroller, its an adc + pga ready to use.
you are essentially suggesting the same thing, just without the pga and in a bigger package.
Im not referring to you sketch per say. The import part code here is the uinput to make the device for the user to use. The micro controller way you can turn a ardunio and teensy into a usb game controller and do the code
-
Okay 2 things I do have an Arduino but no trendy I could easily get one tho. I am kinda a noob about raspberry pi but not Arduino. I have no idea how to use the https://www.adafruit.com/product/1083
Could those joysticks then be used? Also could you add a left and right trigger and other button. Also I would need a wiring hookup for the pi and second thing. There is no need for arguing on this subject. Back to the first of you could I have never used a joystick so maybe a qiring diagram for the Arduino sorry if I am asking to much but like I said earlier I am a noob for the raspberry pi -
This post is deleted! -
So I still need some guides
How do you get reputation -
if you want to go arduino route https://github.com/NicoHood/HID teensy has many tutorials and guide online as well.
The solution to use the pi is posted above by me will get your axis reading and the button pressed via uinput. The first post give you a link to an adc you will need one which one is up to you.
-
the 2 routes posted by me and @grant2258 is essentially the same, alltho the adc + pga is clearly superior and im quite sure you can also use the same code aswell-
the adc+pga is also "ready to use" package where as you would need to make a small circuit to utilize the MCP3008 chip.however, considdering this is all running on a pi, the i2c way works via a python script and you say you already have an arduino, i would definitely avoid the i2c way and just use the arduino as already has analog input pins, can act as a usb gamepad and will require minimal configuration on the pi itself.
-
Okay so I hook up the 2 joysticks to the Arduino from the Adafruit product and go from there hook up to the analog input and hook up from the usb upload cable correct me maybe today I’ll draw up a sketch with my wiring idea
So I’m new to this forum so how do you get reputation
-
I think the reputation works with the little arrows on a post if its helpful you click up (upvote) if its unhelpful click down
-
if you use an arduino, you will not need an adc as it can already read analog inputs.
im unsure if you need 2 or 4 for each joystick anf you havent actually mention which model of arduino you have, but iirc the uno has at least 8 analog input. -
@Halvhjearne said in 2 Joystick 8 Button Controller Hook Up:
if you use an arduino, you will not need an adc as it can already read analog inputs.
im unsure if you need 2 or 4 for each joystick anf you havent actually mention which model of arduino you have, but iirc the uno has at least 8 analog input.Okay I can use a metro uno or mega.
-
it seems that the metro and uno actually only has 6 analog inputs, so if each joystick needs 4 analog inputs, you will need to use the mega for your project.
if you only need 2 analog inputs per joystick, you should be able to use any of those for both joysticks and buttons. -
@Halvhjearne said in 2 Joystick 8 Button Controller Hook Up:
it seems that the metro and uno actually only has 6 analog inputs, so if each joystick needs 4 analog inputs, you will need to use the mega for your project.
if you only need 2 analog inputs per joystick, you should be able to use any of those for both joysticks and buttons.so which joysticks should I use do you have a suggestion?
-
it depends on what you are trying to build, but i thought you were using the ones you linked in the op?
-
Yes but how should I hook them up
-
i think this would become a bit too extensive to do via forum posts, but you can try google "arduino gamepad" or "arduino joystick" and you should be able to find plenty of both wiring and code examples to use.
i have considdered doing something similar myself, but i never got around to it since i already own a xin-mo, which works just fine for now, so please show what you end up with, once you are done.
-
Okay cool it might be a while I am doing a portapie homemade so I have to get that fixed and finished before I do that
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.