Created
May 24, 2024 14:17
-
-
Save zsteva/acc034164a9c1baa388084a14bc06dec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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