fix: update touch sensor connection logic to correctly identify connection status
This commit is contained in:
parent
7b18266534
commit
4a55620d39
@ -60,15 +60,10 @@ void setup() {
|
|||||||
|
|
||||||
// Touch Sensor
|
// Touch Sensor
|
||||||
pinMode(TTP223_PIN, INPUT_PULLUP);
|
pinMode(TTP223_PIN, INPUT_PULLUP);
|
||||||
if (digitalRead(TTP223_PIN) == HIGH)
|
if (digitalRead(TTP223_PIN) == LOW)
|
||||||
{
|
|
||||||
Serial.println("Touch Sensor is not connected");
|
|
||||||
touchSensorConnected = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Serial.println("Touch Sensor is connected");
|
Serial.println("Touch Sensor is connected");
|
||||||
touchSensorConnected
|
touchSensorConnected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user