Python code to use thev 8bitdo zero2 controller with a Raspberry Pi
Project description
8bitdo zero2
Python code to use the 8bitdo zero2 controller with a Raspberry Pi.
How to use
Installation
$ pip install eightbitdo-zero2
Usage example
from gpiozero import LED
from eightbitdo_zero2 import EightBitDoZero2
# led
red = LED(17)
blue = LED(10)
def main():
# Initialize controller
controller = EightBitDoZero2(
on_y=red.on,
off_y=red.off,
on_a=blue.on,
off_a=blue.off,
)
# Start listen
controller.listen()
if __name__ == "__main__":
main()
There are more example code in examples.
Options
Controller initialize options.
| name | type | default | detail |
|---|---|---|---|
| device_path | string | "/dev/input/js0" | File path to which device is connected. |
| debug | boolean | False | Debug mode setting. When True, The entered command is displayed on STDOUT. |
| on_<button_name> | function | lambda: None | Action when the button is pressed. |
| off_<button_name> | function | lambda: None | Action when the button is Released. |
License
This software is released under the MIT License, see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eightbitdo_zero2-0.1.3.tar.gz.
File metadata
- Download URL: eightbitdo_zero2-0.1.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c17474735133741f22dc1024d745c6c685f97481f7b39d8a8ee38d6659da6a7
|
|
| MD5 |
026a081d184cb27e1f1ce216f6998700
|
|
| BLAKE2b-256 |
5c336d2f49f3eb432c28725b867fc344465141989d7932759eab0dff5189e291
|
File details
Details for the file eightbitdo_zero2-0.1.3-py3.8.egg.
File metadata
- Download URL: eightbitdo_zero2-0.1.3-py3.8.egg
- Upload date:
- Size: 5.7 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb0b2ef6ce11736eb1b59763dd7f0d5f3808b8f168bb390a989e51a680aac3be
|
|
| MD5 |
406df4cc4c993212efbcedc8949c6261
|
|
| BLAKE2b-256 |
42a36cb5652314480137e70d5ff3c64e06f1c91d3fe4392b454a15536bc47852
|
File details
Details for the file eightbitdo_zero2-0.1.3-py3-none-any.whl.
File metadata
- Download URL: eightbitdo_zero2-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dc439d603ef317b134a43e01e997b31c76023f0d509438fd5780287241c39fe
|
|
| MD5 |
f1491ab0fc525ecc839354ad1b36594f
|
|
| BLAKE2b-256 |
430ba7a66594c5c5359c1d5d9dba79490641bcce468db10e784667c321a00ffc
|