Giter Site home page Giter Site logo

aelzeiny / switch-controller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phroon/switch-controller

1.0 1.0 0.0 19.26 MB

Control the switch via Linux PC

License: Other

C 73.33% C++ 20.45% Python 2.13% Batchfile 0.01% Assembly 0.29% Makefile 2.91% JavaScript 0.07% HTML 0.03% CSS 0.04% XSLT 0.50% C# 0.27%

switch-controller's Introduction

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

switch-controller's People

Contributors

ali1234 avatar fossephate avatar phroon avatar aelzeiny avatar

Stargazers

William Schmidt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.