Microtube Docs
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.

ArgumentTypeDescription
fingerslist[str]Any of Thumb, Index, Middle, Ring, Pinky
enabledlist[bool]Whether each finger actuates
intensity_alist[float]Intensity 0–1 per finger
intensity_blist[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

Soon

The full method list (other actuation modes and parameters) is being documented. Read the source in the HaptGlovePython repo in the meantime.