https://github.com/pleft/omega2-python-evdev
python-evdev library for Onion Omega2
https://github.com/pleft/omega2-python-evdev
Last synced: 8 months ago
JSON representation
python-evdev library for Onion Omega2
- Host: GitHub
- URL: https://github.com/pleft/omega2-python-evdev
- Owner: pleft
- Created: 2017-06-28T20:42:06.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-29T07:13:25.000Z (almost 9 years ago)
- Last Synced: 2025-04-08T12:50:47.562Z (about 1 year ago)
- Language: Python
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# omega2-python-evdev
python-evdev library for [Onion Omega2](https://onion.io/)
## Instructions
- ssh to your onion omega2
- download the package: `wget https://github.com/pleft/omega2-python-evdev/raw/master/packages/python-evdev_0.4.7-1_mipsel_24kc.ipk`
- install it: `opkg python-evdev_0.4.7-1_mipsel_24kc.ipk install`
- use it in your python scripts! For more: http://python-evdev.readthedocs.io
## usb-gamepad.py
Plug a usb joystick/gamepad on your onion [expansion dock](https://docs.onion.io/omega2-docs/expansion-dock.html). After a few seconds a new `device file` should appear in omega's `/dev/input` directory, usually named `event0`. `python-evdev` can read this device file and faciliates the translation of the events.
For now `usb-gamepad.py` script just connects to `/dev/input/event0` and displays info about the joystick/gamepad controller connected to the usb port. It can be expanded to perform basic functions such as read the buttons' states.
Run it with: `python usb-gamepad.py`