Python driver for Nintendo Switch Joy-Con
Project description
Python driver for Nintendo Switch Joy-Con
install
pip install joycon-python
usage
Quick status check
cd joycon-python/
python pyjoycon/joycon.py
or Use as module
from pyjoycon import device from pyjoycon.joycon import JoyCon ids = device.get_ids("R") joycon = JoyCon(*ids) joycon.get_status()
status values
{ 'battery': { 'charging': 0, 'level': 2 }, 'buttons': { 'right': { 'y': 0, 'x': 0, 'b': 0, 'a': 0, 'sr': 0, 'sl': 0, 'r': 0, 'zr': 0 }, 'shared': { 'minus': 0, 'plus': 0, 'r-stick': 0, 'l-stick': 0, 'home': 0, 'capture': 0, 'charging-grip': 0 }, 'left': { 'down': 0, 'up': 0, 'right': 0, 'left': 0, 'sr': 0, 'sl': 0, 'l': 0, 'zl': 0 } }, 'analog-sticks': { 'left': { 'horizontal': 0, 'vertical': 0 }, 'right': { 'horizontal': 2170, 'vertical': 1644 } }, 'accel': { 'x': 879, 'y': 1272, 'z': 549 }, 'gyro': { 'x': -354, 'y': -7, 'z': 281 } }
cython-hidapi
to use Bluetooth / HID connection in Python.
environments
- macOS Mojave (10.14.6)
- Python (3.7.4)
- hidapi (0.7.99.post21)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size joycon_python-0.1.2-py3-none-any.whl (4.8 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size joycon-python-0.1.2.tar.gz (4.2 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for joycon_python-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62403472b2d8a8ba66f3b1809be91e100a3cfdb092084e1057612d19c13c25b4 |
|
MD5 | d6d172b82480f271bc4b34281155d93a |
|
BLAKE2-256 | 60aaf3942435700de621ec336fa8ff47d52432ee6f1dbe419985b17d343a8d0e |