Skip to content

Commit 3c707f6

Browse files
committed
Simplifications to code
1 parent f4f6942 commit 3c707f6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

adafruit_circuitplayground/circuit_playground_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def _touch(self, pin):
350350
touchin = touchio.TouchIn(pin)
351351
touchin.threshold += self._touch_threshold_adjustment
352352
self._touches[pin] = touchin
353-
return self._touches[pin].value
353+
return touchin.value
354354

355355
# We chose these verbose touch_A# names so that beginners could use it without understanding
356356
# lists and the capital A to match the pin name. The capitalization is not strictly Python
@@ -511,8 +511,7 @@ def adjust_touch_threshold(self, adjustment):
511511
print('Touched pad A1')
512512
"""
513513
for touch_in in self._touches.values():
514-
if isinstance(touch_in, touchio.TouchIn):
515-
touch_in.threshold += adjustment
514+
touch_in.threshold += adjustment
516515
self._touch_threshold_adjustment += adjustment
517516

518517
@property

0 commit comments

Comments
 (0)