fix: remove pullups, invert touch logic for HS-S43A sensors

This commit is contained in:
eddy 2026-08-01 22:54:31 +02:00
commit 5bb87ed4a4
2 changed files with 49 additions and 19 deletions

View file

@ -217,8 +217,8 @@ void setup() {
allProvisioned = keyProvisioned && uuidProvisioned && serverProvisioned;
pinMode(TOUCH1_PIN, INPUT_PULLUP);
pinMode(TOUCH2_PIN, INPUT_PULLUP);
pinMode(TOUCH1_PIN, INPUT);
pinMode(TOUCH2_PIN, INPUT);
pinMode(BUTTON_PIN, INPUT);
if (allProvisioned) {
@ -346,8 +346,8 @@ void loop() {
static uint32_t t1Change = 0;
static uint32_t t2Change = 0;
static uint32_t btnChange = 0;
bool t1Raw = (digitalRead(TOUCH1_PIN) == LOW);
bool t2Raw = (digitalRead(TOUCH2_PIN) == LOW);
bool t1Raw = (digitalRead(TOUCH1_PIN) == HIGH);
bool t2Raw = (digitalRead(TOUCH2_PIN) == HIGH);
bool btnRaw = (digitalRead(BUTTON_PIN) == LOW);
if (t1Raw != t1Stable) { t1Change = millis(); t1Stable = t1Raw; }
if (t2Raw != t2Stable) { t2Change = millis(); t2Stable = t2Raw; }