-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Buttons not working on 2nd PS2 controller. #35
Comments
At a first glance I don't see anything that could cause that behaviour, the code looks correct to me. I suggest that you print psx2.getButtonWord() in order to see if the button values are correct in there, in which case the problem would lie in the Joystick library. You might also try using JOYSTICK_TYPE_GAMEPAD. Oh, and I assume you have already tried to swap the controllers and made sure that the problem is not in the controller itself. On a side note, there is no need to use different pins for the two controllers. The CMD, DAT and CLK can be shared among all the controllers, only the ATT line must be different for every controller. |
I followed your advice and changed to using shared pins and JOYSTICK_TYPE_GAMEPAD. This did mess up my button mapping (Tested with psx1, since psx2's buttons don't work). Tested here: https://www.onlinemictest.com/controller-tester I also tested each controller separately and they both worked on psx1 interface. Do you have an easy way to map each of the buttons or atleast know which number from 0-15 corresponds to which buttons on the dualshock 2 controller ? Now, for the Code Snippet:
Output Snippet:
|
That means that PsxNewLib is doing the right thing, so the problem either lies in the Joystick library or somewhere else. Now I cannot remember exactly why I picked that particular joystick library, but I'm sure there are many others around, so you might try to switch to a different one and adapt the code. Although, maybe there is something else to try first: have a look here (maybe also here and/or here). I had to do something similar for another private board that creates several USB joystick devices. Please report back your findings! |
Yes, I talked with ArduinoJoystickLibrary maintainer too. Seems like this might be the cause of the issue. I'll look into it and report my findings. BTW, I just successfully tested the rumble feature, it works well (though with some delay in starting the rumble after pressing the button). How do I add this functionality to the psx2usb code ? I'm searching for any example sketches on the internet and I'd appreciate your input. |
Update: The issue has been solved ! Thanks for the help ! :D |
BTW, I'm having trouble with the level shifter. |
Glad you solved the issue! There is no problem in sharing the signal lines even among 1000 controllers, as only one is read at a time anyway and the others are in high-impedence. If they seem a bit sloppy, you probably have to check the time interval at which you are reading them and make sure that you do it at least 50-60 times per second per controller. Using Hardware SPI might help a bit and is the recommended way, in any case. Make sure to also cable the ACK pin, as that will be used one day and will make readings faster. No idea about rumble, sorry. I am not very interested in that. For the level shifter, check out the schematics of PsxControllerShield. It can be simplified, but that is definitely working. Also note that only a few MOSFETs will work, you can't just use a random one in that configuration. Stick to BSS138. |
As the title says,
I've connected two dualshock 2 controllers to a pro micro.
The 1st controller works flawlessly, including analog sticks.
The 2nd controller's buttons do not work, only the analog sticks work.
Here's my code:
I'm using Arduino IDE v2.3.4.
I'm using the latest git version of all 3 libraries: PsxNewLib, DigitalIO, ArduinoJoystick
I got my first pro micro and arduino UNO yesterday, so I'm an absolute newb at this.
Any help or suggestions regarding this is much appreciated :D
The text was updated successfully, but these errors were encountered: