Skip to content

Phroon/switch-controller

 
 

Repository files navigation

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

About

Control the switch via Linux PC

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 73.5%
  • C++ 20.5%
  • Makefile 2.9%
  • Python 1.9%
  • XSLT 0.5%
  • Assembly 0.3%
  • Other 0.4%