Zayitskin / switch-controller

Control the switch via Linux PC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:Other


Languages

Language:C 73.5%Language:C++ 20.5%Language:Makefile 2.9%Language:Python 1.9%Language:XSLT 0.5%Language:Assembly 0.3%Language:C# 0.3%Language:JavaScript 0.1%Language:CSS 0.0%Language:HTML 0.0%Language:Batchfile 0.0%