int buttonPin = 12; // the number of the push button pin
int state = false; // État du bouton
void setup() {
Serial.begin(9600);
pinMode(buttonPin, INPUT); // set push button pin into input mode
}
void loop() {
// if (digitalRead(buttonPin) == LOW) { // if the button is not pressed
// if (state == false) {
// Serial.println("OFF!");
// state = !state;
// }
// }
// if (digitalRead(buttonPin) == HIGH) { // if the button is pressed
// if (state == true) {
// Serial.println("ON!");
// state = !state;
// }
// }
delay(1000);
Serial.print(digitalRead(buttonPin));
}