const int botaoPin = 25;
int estadoBotao = 0;
void setup() {
Serial.begin(115200);
pinMode(botaoPin, INPUT_PULLUP);
}
void loop() {
estadoBotao = digitalRead(botaoPin); // Lê o estado do botão
if (estadoBotao == LOW) { // Se o botão estiver pressionado
Serial.println("ligado");
} else { // Se o botão não estiver pressionado
Serial.println("desligado");
}
delay(1000);
}