fix: remove pullups, invert touch logic for HS-S43A sensors
This commit is contained in:
parent
a84727abdc
commit
5bb87ed4a4
2 changed files with 49 additions and 19 deletions
|
|
@ -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; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue