Skip to content

Commit 40661d1

Browse files
committed
Instable Touch Pins
1 parent c096e4b commit 40661d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/AudioTools/AudioActions.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,12 @@ class AudioActions {
159159
if (a->activeLogic == ActiveTouch) {
160160
int value = touchRead(a->pin);
161161
result = value <= touchLimit;
162-
//LOGD("touch pin: %d value %d -> %s", a->pin, value, result ? "true":"false");
162+
if (result){
163+
// retry to confirm reading
164+
value = touchRead(a->pin);
165+
result = value <= touchLimit;
166+
LOGI("touch pin: %d value %d (limit: %d) -> %s", a->pin, value, touchLimit, result ? "true":"false");
167+
}
163168
} else {
164169
result = digitalRead(a->pin);
165170
}

0 commit comments

Comments
 (0)