const int touch_pin = A5;
const int touch_threshold = 30; // Define the touch threshold
void setup(void) {
Serial.begin(115200);
}
void loop(void) {
int touchValue = analogRead(touch_pin); // Read the touch sensor value
Serial.print("Touch value: ");
Serial.println(touchValue);
// Check if the touch value is below the threshold
if (touchValue < touch_threshold) {
Serial.println("Touch detected!");
}
delay(1000);
}