Cruising along just fine for a long time then suddenly I can't get any touch pins to respond. Tried several different ESP32's, all the different touch pins. Reinstalled the IDE. All it will do is respond with a value a bit over 100.
// ESP32 Touch Test
// Just test touch pin - Touch0 is T0 which is on GPIO 4.
#define TOUCH_PIN_THRESHOLD 30 // Smaller value will treated as button press
void setup() {
Serial.begin(115200);
delay(1000); // give me time to bring up serial monitor
Serial.println("ESP32 Touch Test");
}
void loop() {
int x = touchRead(4);
Serial.println(x); // get value of Touch 0 pin = GPIO 4
delay(1000);
}
You can cross check your method with this tutorial. This one uses GPIO 4 as the touch pin. It uses a male to female jumper wire to test the touch sensor. If none of the methods work, probably the capacitive touch sensor inside your ESP32 is gone.
@fatfenders Installation and Troubleshooting is for Problems with the Arduino IDE itself NOT your project. It says so in the description of the section. Therefore I have moved your post here. Please be more careful where you post in future.