Giter Club home page Giter Club logo

porygon's Introduction

Porygon consists of two parts: a digital circuit that is wired between a RasPi and a JoyCon, as well as a script to run that circuit.

For a video of it in action, and some tips on how to put this together, see the announcement post at https://invoked.net/2019-03-26-joycon-circuit/

Circuit

The parts listed in the circuit:

Component Link Function
PI-IO raspi Array of GPIO pins on the raspi, used to toggle analog switches and to drive an I2C bus.
DG333A Analog Switch (x2) digikey Single Pole, Double Throw switches. To bridge points to COL, emulating a button press.
MCP4725 (x2) sparkfun Digital Analog Converters. The pi sends a signal here to output a variable voltage, which will emulate what the joystick does. I bought breakout boards instead of the chip itself to make soldering easier.

Script

To actually get the inputs going, you'll need shell access to the PI in your circuit. Then,

git clone https://github.com/moribellamy/porygon.git
cd porygon
python3 -m virtualenv venv
. venv/bin/activate
pip install -r requirements.txt

If your circuit diagram varies from the one documented here, there are some settings you can put in config.ini. This is if you didn't use the same pin numbers on your PI GPIO array, or if your power source isn't a clean five volts.

Then you are in control!

from porygon import *
import time

tilt_x(100)  # Go left a while!
time.sleep(1)
still()  # Zero out the joystick.

press(A)
press(X)  # And so forth.

For an example end to end script, which takes input from a webcam, read pokemon_lets_go.py.

Development

More games and automations could be added. Use py.test to run all of the tests.

porygon's People

Contributors

moribellamy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ashcoding

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.