Skip to content
Control the switch via Linux PC
C C++ Makefile Python XSLT Assembly Other
Branch: master
Clone or download
Pull request Compare This branch is 8 commits ahead of Phroon:master.
Latest commit f68c2e0 Sep 7, 2018

README.md

switch-controller

Lets you control a switch from your Linux Box

Hardware

To build and flash firmware onto an Arduino Uno Rev3:

  • You will need packages dfu-programmer and avr-gcc or avr-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
      
  • Update MCU in the makefile to match your chip, either MCU = atmega16u2 or MCU = 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
      
  • Install python libraries pyserial, evdev, PySDL2, and tqdm

     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.

Credit and Thanks

You can’t perform that action at this time.