Lets you control a switch from your Linux Box
- Board with either a ATmega16u2 or ATmega32u4
- E.g. A blank Arduino Uno Rev3 or an Adafruit ItsyBitsy 32u4
- USB to Serial Converter
- E.g. Another blank Arduino Uno Rev3 or an Adafruit CP2104 Friend
-
You will need packages
dfu-programmer
andavr-gcc
oravr-libc
.- To install these on a Mac with homebrew:
brew install dfu-programmer brew tap osx-cross/avr brew install avr-gcc
- On Linux Mint 19:
sudo apt-get install dfu-programmer sudo apt-get install avr-libc
- To install these on a Mac with homebrew:
-
Update
MCU
in the makefile to match your chip, eitherMCU = atmega16u2
orMCU = atmega32u4
. -
make
-
Follow the DFU mode directions to flash
Joystick.hex
onto the 16u2 of your Arduino UNO R3. Abridged instructions:- Jumper RESET and GND of the 16u2
sudo dfu-programmer atmega16u2 erase sudo dfu-programmer atmega16u2 flash Joystick.hex sudo dfu-programmer atmega16u2 reset
-
Install SDL2
- To install these on a Mac with homebrew:
brew install sdl2
- On Linux Mint 19:
sudo apt-get install libsdl2-dev
- To install these on a Mac with homebrew:
-
Install python libraries
pyserial
,evdev
,PySDL2
, andtqdm
pip install pyserial pip install evdev pip install PySDL2 pip install tqdm
-
Connect the Switch Control board flashed with
Joystick.hex
to the Switch and the USB to Serial converter to the Linux PC. -
Connect the the USB to Serial converter to the Switch Control board
- Example wiring diagram using a second Arduino as a USB to Serial Converter:
-
Run
python bridge.py
- You can see a list of available command line options with
python bridge.py -h
- If using a PS3 controller you may need to press the PS button before the controller sends any inputs.
- You can see a list of available command line options with
- Thanks to @wchill for his work
- Thanks to https://github.com/ebith/Switch-Fightstick and https://github.com/mfosse/switch-controller