const int buttonPin = 26; // GPIO pin for the tactile button
void setup() {
pinMode(buttonPin, INPUT_PULLUP); // Internal pull-up resistor for the button
Serial.begin(115200);
}
void loop() {
int buttonState = digitalRead(buttonPin);
if (buttonState == LOW) {
Serial.println("Button pressed!");
delay(500); // Add a small delay to avoid rapid multiple readings
}
}