I would like to emulate a HORI Gamecube controller with the Arduino Micro for the Nintendo Switch to recognize it. I would like an end result where I just plug my arduino into the switch and the switch sees it as just another compatible controller.
My current approach is basically following these instructions:
I'm going to show you how to emulate an Xbox controller with an Arduino, using a USB capable microcontroller and the ArduinoXInput library.
Est. reading time: 15 minutes
Here is main library in question:
However, the library is made for emulating XBox controllers.
# Using the XInputUSB API
The Arduino XInput implementation is broken up into three separate components, of which this library is just one part:
1. **The Library**, which is user-facing and contains lots of syntactic sugar to make it easy to manipulate the USB data.
2. **The Backend**, which handles the USB communication itself including endpoint memory management.
3. **The USB API**, which provides a standardized interface between these two components.
The goal of this document is to describe how the USB API works so that you can use it to build XInput support for other board types while maintaining compatibility with this library.
---
## Overview
Here is the C++ API header in all of its glory:
```cpp
#define USB_XINPUT
class XInputUSB {
This file has been truncated. show original
In the above documentation, it says something about being able to modify the device and configuration descriptors for the board. I would be able to sniff those from the HORI controller, but I don't know how I could actually change that on the Arduino Micro. How would I do that?
Also, do you think this approach would work in general?
Update
While looking at this, I found:
/*
* Project Arduino XInput - AVR Core
* @author David Madison
* @link github.com/dmadison/ArduinoXInput_AVR
* @license MIT - Copyright (c) 2019 David Madison
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
This file has been truncated. show original
Listing the descriptors. I'm wondering if I would be able to modify this and load the core onto the arduino.
I'm starting to understand the library better, and I'm now thinking of just forking the original Arduino core and working from there.