Developers / API reference / Python library
Python library
The HaptGlovePython library builds BLE payloads that drive the glove. Reference for the parts you'll use most.
Haptics
Create a Haptics instance for a hand, then build payloads to write to the glove's BLE characteristic.
python
from Haptics import Haptics
haptics = Haptics("right") # or "left"hexr_pressure_multiple(fingers, enabled, intensity_a, intensity_b)
Returns the bytes to write for pressure across several fingers at once.
| Argument | Type | Description |
|---|---|---|
| fingers | list[str] | Any of Thumb, Index, Middle, Ring, Pinky |
| enabled | list[bool] | Whether each finger actuates |
| intensity_a | list[float] | Intensity 0–1 per finger |
| intensity_b | list[float] | Intensity 0–1 per finger |
python
data = haptics.hexr_pressure_multiple(
["Index","Middle"], [True,True], [0.8,0.8], [1.0,1.0])
await client.write_gatt_char(CHAR_UUID, data)Helper scripts
AddressDiscovery.py— find your glove's BLE addressCharacteristicDiscovery.py— list the glove's BLE characteristicsExampleHaptics.py— a ready-to-run example
Soon
The full method list (other actuation modes and parameters) is being documented. Read the source in the HaptGlovePython repo in the meantime.