1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Question Issues with multiple DIY arduino driven button boxes

Discussion in 'DIY peripherals' started by Sebastian2, Mar 10, 2026.

  1. Sebastian2

    Sebastian2 Active Member

    Joined:
    Dec 17, 2023
    Messages:
    119
    Balance:
    514Coins
    Ratings:
    +66 / 1 / -0
    Hi,

    I've build two button boxes with different sets of buttons, switches etc.. Each one is driven by an arduino pro micro. Codewise, I am using the Joystick.h library by MHeironimus so that windows sees those arduinos as regular game controllers.

    However, both game controllers show up under the same name: "Arduino Micro". This bothered my only slightly at first, but after binding all my game's buttons to those switches, I see that Windows sometimes mixes both button boxes up. A command linked to a button on Box 1 is triggered by some button on Box 2 and vice versa.

    That's why I want to assign names to my button boxes. They should show up on windows as "Box 1" and "Box 2". How can I do that?

    I tried both ChatGPT and Copilot to help me with this, but they are both hallucinating like crazy. Lots of suggestions, but none of them work. Maybe you guys have an idea or can point me in the right direction?

    Best regards,
    Sebastian
  2. michel123

    michel123 Member

    Joined:
    Jan 12, 2024
    Messages:
    90
    Occupation:
    cadre sncf
    Location:
    lezignan-corbieres
    Balance:
    192Coins
    Ratings:
    +38 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor, Arduino, Motion platform
    normally it's that :

    ✅ SOLUTION 1 : modify l’ID of joystick
    in your code, ID différent :


    Joystick_ Joystick(
    0x03, // <-- modifiy here (ex: 0x03 for carte 1, 0x04 for carte 2)
    JOYSTICK_TYPE_GAMEPAD,
    32, 0,
    false, false, false,
    false, false, false,
    false, false, false,
    false, false
    );

    Exemple :

    • Boîtier 1 → 0x03
    • Boîtier 2 → 0x04

    SOLUTION 2 (real solution ) : modifiy name of USB

    In Arduino :


    hardware/arduino/avr/cores/arduino/USBCore.cpp

    Or :


    boards.txt


    ✏️ Modify :

    #define USB_PRODUCT "Joy 1"

    and the other card :


    #define USB_PRODUCT "Joy 2"
  3. Sebastian2

    Sebastian2 Active Member

    Joined:
    Dec 17, 2023
    Messages:
    119
    Balance:
    514Coins
    Ratings:
    +66 / 1 / -0
    Thank you. Looking at the formatting, I assume that is also output from a LLM?

    The first solution will not make the gamecontrollers appear with different names under windows, right? There is no string defined on how the gamecontroller should be named.

    The second solution is not quite laid out in detail. I wouln't know how to act on that. There is a segment of a path mendioned, but not a full path. After scanning my harddrive, I found this location

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp

    There is also this location, but the path is slightly different:
    C:\Users\<Username>\AppData\Local\Arduino 15\packages\arduino\hardware\avr\1.8.6\cores\arduino\USBCore.cpp

    However, in both paths there is no boards.txt to be found.

    Looking for boards.txt on my drive, I found it in those locations:

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\boards.txt
    C:\Users\<Username>\AppData\Local\Arduino 15\packages\arduino\hardware\avr\1.8.6\boards.txt

    But the real kicker is, that your post tells me I should modify USBCore.cpp OR boards.txt.
    Like, for real? OR? It doesn't matter which file I modify? This seems highly unlikely.

    There is no "#define USB_PRODUCT" in boards.txt. So I guess I should modify USBCore.cpp. But if so, why is the boards.txt mentioned?

    I find that string in the USBCore.cpp. But what now? I guess for one gamectonroller I should give it one name, and for the other I should give it another name. But how do I do this exactly? I'm guessing I need two copies of that file. How should I name them, so that the Arduino IDE will find it? Are there any additional files or folders I need to make a copy of?

    I'm sorry, but this description has way too large gaps that I can't figure out on my own.

    I asked ChatGPT to give me a links to websites that talk about "naming" arduino based gamecontrollers. As the LLM was hallucinating so strongly, I was hoping it could guide me to human-written ressources. This kind of worked. One of the links lead me to a guide that did't work for me, but contained a link to a guide that did. I found the solution to my problem here:

    https://gist.github.com/nebhead/c92da8f1a8b476f7c36c032a0ac2592a
  4. michel123

    michel123 Member

    Joined:
    Jan 12, 2024
    Messages:
    90
    Occupation:
    cadre sncf
    Location:
    lezignan-corbieres
    Balance:
    192Coins
    Ratings:
    +38 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor, Arduino, Motion platform
    I would only modify the first solution; it doesn't change the name but prevents Windows from seeing the same controller twice. So, if you configure your controllers, they shouldn't get confused when you restart.

    Solution 2 is indeed one or the other, and if you have USBcore, then it's in that one. I haven't gone any further with the verification, though, as the first one works for me!