Skip to content
Merged
Changes from all 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
4 changes: 2 additions & 2 deletions adafruit_funhouse/peripherals.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def __init__(self):
board.CAP9,
):
cap = touchio.TouchIn(pin)
cap.threshold = 20000
self._ctp.append(cap)

self.i2c = board.I2C()
Expand Down Expand Up @@ -180,8 +181,7 @@ def slider(self):
val = 0
cap_map = b"\x01\x03\x02\x05\x04\x0c\x08\x18\x10"
for cap in range(5):
raw = self._ctp[cap + 3].raw_value
if raw > 15000:
if self._ctp[cap + 3].value:
val += 1 << (cap)
for i, pos in enumerate(tuple(cap_map)):
if val == pos:
Expand Down