Code Monkey home page Code Monkey logo

Comments (4)

dmadison avatar dmadison commented on June 8, 2024

It's technically possible but you'd essentially need to recreate much of the project from scratch. The current library is built around emulating the wired controller. To emulate multiple controllers on one microcontroller you'd need to emulate the Xbox 360 wireless receiver, which is a different sort of beast.

To start, you'd need to reverse engineer how the wireless receiver works. Figure out which USB endpoints correspond to which controllers, how to enable/disable different controllers, how data packets are formatted, and determine what (if any) communication is going on in the background.

You'd then need to build the customized USB stack for the microcontroller of your choice. I'd imagine that the 32U4 (Leonardo, Pro Micro, etc.) is out because it only has the hardware for a handful of USB endpoints, but I haven't looked at the wireless receiver's descriptors myself so that's just a hunch.

Lastly, you'd need to modify the library backend API to support multiple controllers. At that point the library would only need a constructor modification (e.g. "XInput(uint8_t controller_number)") and then you could create different objects for each controller. In theory, at least.


In short, it would be a lot of work. It's not impossible, mind you, but I have no interest in doing it. Especially since you can get the same result by adding another $2 microcontroller.

from arduinoxinput.

sarcus avatar sarcus commented on June 8, 2024

Ok, thanks. I thought it could work by emulating USB Hub, but now I see on the web that it is not so easy.

$2 microcontroller? How would you do that? I thought second Arduino board is required, which is quite more expensive.

from arduinoxinput.

dmadison avatar dmadison commented on June 8, 2024

You could either use a second Arduino board or just the bare 32U4 microcontroller with the supporting electronics. 'Knockoff' Arduino Pro Micros are around $2 from Chinese wholesalers (AliExpress and the like).

from arduinoxinput.

sarcus avatar sarcus commented on June 8, 2024

Ok, I see. Thank you.

from arduinoxinput.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.