-
Hi there! I'm trying to make something that reads multiple GC controllers and then outputs as one HID device over USB, for use with a rhythm game. Do you foresee any issues with this @NicoHood? I see the GamecubeMultiSingleplayer example, but I'm hoping to read 4 controllers instead of 2 and I'm wondering if there are any hidden issues I'll run into. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You should be fine. I've read 4 controllers before. You'll need to read them one at a time, of course, since the sending the controller command and receiving the data is real-time assembly. Each send/receive takes about 1/3 millisecond per controller. You'll need to send the data over serial as bytes (don't send the buttons individually). Each controller has 3 status bytes and 8 data bytes. It adds up fast and filling you serial buffer often will halt the program. I would suggest you use a device that has hardware serial because you might find that software serial may not keep up with a high polling rate. You might run into an issue when you have at least one controller unplugged. Since the library waits ~70ms for a controller response. By default when you call controller.read() if the device is not connected, it tries to initialize the controller and waits for a timeout. So if you have an unplugged controller it will hang your program and you might notice a stutter in your polling. Check out this recent issue about that: #51 |
Beta Was this translation helpful? Give feedback.
You should be fine. I've read 4 controllers before. You'll need to read them one at a time, of course, since the sending the controller command and receiving the data is real-time assembly. Each send/receive takes about 1/3 millisecond per controller.
You'll need to send the data over serial as bytes (don't send the buttons individually). Each controller has 3 status bytes and 8 data bytes. It adds up fast and filling you serial buffer often will halt the program. I would suggest you use a device that has hardware serial because you might find that software serial may not keep up with a high polling rate.
You might run into an issue when you have at least one controller unplugged. Since t…