Skip to content

Commit

Permalink
(+) comments in examples for I2C
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Apr 8, 2020
1 parent caad98d commit 9dda009
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/cirque_pinnacle_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

def print_data(timeout=6):
"""Print available data reports from the Pinnacle touch controller
until there's no touch for a period of ``timeout`` seconds."""
until there's no input for a period of ``timeout`` seconds."""
print("using {} mode".format("Relative" if tpad.data_mode < ABSOLUTE else "Absolute"))
start = time.monotonic()
while time.monotonic() - start < timeout:
Expand Down
3 changes: 2 additions & 1 deletion examples/cirque_pinnacle_usb_mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@

def move(timeout=10):
"""Send mouse X & Y reported data from the Pinnacle touch controller
for a period of ``timeout`` seconds."""
until there's no input for a period of ``timeout`` seconds."""
if mouse is None:
raise OSError("mouse HID device not available.")
start = time.monotonic()
while time.monotonic() - start < timeout:
data = tpad.report() # only returns fresh data (if any)
if data: # is there fresh data?
mouse.send_report(data) # not using scroll wheel; nor back/forward butons
start = time.monotonic()
mouse.send_report(b'\x00' * 4) # release buttons (just in case)

0 comments on commit 9dda009

Please sign in to comment.