Skip to content

Tap matching #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 17, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions adafruit_circuitplayground/circuit_playground_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,24 @@ def detect_taps(self):
@detect_taps.setter
def detect_taps(self, value):
self._detect_taps = value
if value == 1:
self._lis3dh.set_tap(
value, 90, time_limit=4, time_latency=50, time_window=255
)
if value == 2:
self._lis3dh.set_tap(
value, 60, time_limit=10, time_latency=50, time_window=255
)
if hasattr(board, "A0"): # If we're on a CPX or CPC
if value == 1:
self._lis3dh.set_tap(
value, 90, time_limit=4, time_latency=50, time_window=255
)
if value == 2:
self._lis3dh.set_tap(
value, 60, time_limit=10, time_latency=50, time_window=255
)
else: # If we're on a CPB
if value == 1:
self._lis3dh.set_tap(
value, 100, time_limit=4, time_latency=50, time_window=255
)
if value == 2:
self._lis3dh.set_tap(
value, 70, time_limit=10, time_latency=50, time_window=255
)

@property
def tapped(self):
Expand Down