// Button Input + Serial Output
// XIAO ESP32-S3 using CircuitPython-style pin names
const int BUTTON_PIN = D1;
void setup() {
Serial.begin(115200);
pinMode(BUTTON_PIN, INPUT_PULLDOWN);
}
void loop() {
int state = digitalRead(BUTTON_PIN);
if (state == HIGH) {
Serial.println("Button Pressed");
} else {
Serial.println("Button Released");
}
delay(200);
}