Python client for GEX
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gex-client-py/examples/test_touch.py

20 lines
506 B

import time
import gex
# toush sensing test
with gex.Client(gex.TrxRawUSB()) as client:
tsc = gex.TOUCH(client, 'tsc')
print("There are %d touch channels." % tsc.get_channel_count())
tsc.set_button_thresholds([1225, 1440, 1440])
tsc.listen(0, lambda state, ts: print("Pad 1: %d" % state))
tsc.listen(1, lambda state, ts: print("Pad 2: %d" % state))
tsc.listen(2, lambda state, ts: print("Pad 3: %d" % state))
while True:
print(tsc.read())
time.sleep(0.5)