AlanChatham / UnoJoy

UnoJoy! allows you to easily turn an Arduino Uno (or Mega or Leonardo) into a PS3-compatible USB game controller
GNU General Public License v3.0
482 stars 130 forks source link

Not issue.. 4 controllers in megajoy #54

Closed gabysantof closed 9 months ago

gabysantof commented 1 year ago

Is posible to have 4 controllers using arduino mega? I use the "megajoy" and we have a Lot of buttons and analogs inputs on each controllers. So I think that should be cool to have 4 controllers with 12 digital inputs and 3 analogs inputs each one. ( Sorry my english. im from Argentina)

AlanChatham commented 9 months ago

Sorry for the super late response, but if it's any bit of help, you could take a look at the changes between the code in UnoJoy and DoubleJoy, particularly in the ATmega8u2Code stuff, with usb_gamepad.c and .h vs. DoubleJoy_usb_stuff.c and .h

You'd have to also modify the DoubleJoy.c files in both the Arduino library side of things and the ATmega8u2Code side of things to send the right serial data between the two, but that would be the easier part.

IMPORTANT - If you do this, you'll need to change the PID value in the ATmega8u2 usb code, maybe add 2 or 3 to that number, otherwise you'll wind up with PID cache collisions where Windows will have remembered any DoubleJoy controllers you plugged in, and you'd have to uninstall the device to get it to read the new information about how that device is now 4 logical devices