A Python library for integrating the TRIKI motion controller (made by Caps Apps) into your projects.
Project description
TRIKI Library
A Python library for the integrating TRIKI motion controller (made by Caps Apps) into your projects.
This library is still in development. Some things may change sligthly.
What is TRIKI?
TRIKI is a Bluetooth Low Energy (BLE) motion controller that has the shape and size of a bottle cap. It is produced by Caps Apps (also known as HOPX) and sold by 'Żabka', a convenience store franchise.
It was designed to be used in mini-games which are on the store's loyalty app.
Why I made this library
I wanted to make this library to give everyone a way to integrate this niche controller into their own games, experiments and other Python projects.
Features
- Scan for TRIKI controllers
- Connect to TRIKI controller
- Get battery level
- Get IMU data from the controller
- Get state of the built-in button
- Control built-in LED
Platforms
| Platform | Does it work? |
|---|---|
| Windows 10/11 | ✅ Tested |
| macOS | ❔ Untested |
| Linux | ⚠️ Partially tested |
Linux support needs further testing. Some Arch-based distributions may have issues with receiving data.
Installation
pip install triki-library
Usage
# Import the library
import asyncio
from triki import TRIKIScanner, TRIKIController
# Scan for TRIKI controllers
scanner = TRIKIScanner()
await scanner.scan()
devices = scanner.scanned_devices # Returned as list[TRIKIDevice]
devices[0].name # Get device name
devices[0].address # Get device BT address
# Connect to the controller
controller = TRIKIController("AA:BB:CC:DD:EE:FF")
await controller.connect()
controller.is_connected # Check if device is connected
controller.battery_level # Get battery level
controller.spin_x # Get X Spin
controller.spin_y # Get Y Spin
controller.turn_z # Get Z Turn
controller.tilt_x # Get X Tilt
controller.tilt_y # Get Y Tilt
controller.flip_z # Get Z Flip
controller.button_pressed # Check if built-in button is pressed
#turn on LED
await controller.toggle_led(True)
#turn off LED
await controller.toggle_led(False)
# Loop
try:
while controller.is_connected:
# Do stuff
finally:
await controller.disconnect()
# IMPORTANT: disconnect from the controller when you're done with it!
await controller.disconnect()
Examples can be found on the 'examples' directory.
Credits
Library made by Woofter_Wolf
Special thanks to Wojciech "Koksny" Górny for doing the hard work of documenting this device (look here for communication documentation): Link
Copyright
"TRIKI" and "Żabka" are trademarks of Żabka Polska sp. z o.o. "HOPX" is a trademark of Caps Apps sp. z o.o.
This library is an independent, open-source project. It is NOT affiliated, endorsed or sponsored by these companies. This library ships with no software, images or any assets belonging to these companies.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 triki_library-0.1.tar.gz.
File metadata
- Download URL: triki_library-0.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faf81f896277333eca9ae75e834c47a41ea2a763c742cb7d2560313c10ac5ac1
|
|
| MD5 |
8588b3ebe6165898b59c00a4447db02a
|
|
| BLAKE2b-256 |
b4f8b485064c4515d354532c34301c4b1a73bedd293d9ab887f98a884efdbfde
|
File details
Details for the file triki_library-0.1-py3-none-any.whl.
File metadata
- Download URL: triki_library-0.1-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7775327e9d6348268a8e297d3eed2af8f30c7c5dfbccae778ba44070559b5571
|
|
| MD5 |
355966ce35027e613097d381f75f1737
|
|
| BLAKE2b-256 |
988a4111bb44edd8ab2c5767c3af674fda0630628dc8f27819c4f954da21beed
|