Skip to content

Instantly share code, notes, and snippets.

@zsteva
Created May 24, 2024 14:17
Show Gist options
  • Save zsteva/acc034164a9c1baa388084a14bc06dec to your computer and use it in GitHub Desktop.
Save zsteva/acc034164a9c1baa388084a14bc06dec to your computer and use it in GitHub Desktop.
import hid
vendor_id = 1386
product_id = 161
d = hid.device()
d.open(vendor_id, product_id)
while True:
buf = d.read(7)
x = (buf[3] << 8) | buf[4]
y = (buf[5] << 8) | buf[6]
pres = buf[2]
print("x: ", x, "y:", y, "pres:", pres, buf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment