int toto = 0; int pushButton = 5; int LED = 2; bool test = false; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(pushButton, INPUT); pinMode(LED, OUTPUT); digitalWrite (LED, 1); delay (300); } void loop() { // put your main code here, to run repeatedly: int buttonState = digitalRead(pushButton); delay (500); // Serial.println(toto); Serial.println(pushButton); if (buttonState == 0) { digitalWrite (LED, 1); delay (500); digitalWrite (LED, 0); if (test == false) { totoplus1(); test = true; } } else { digitalWrite (LED, 0); test = false; } } void totoplus1() { toto++; } int returntotoplus1() { return toto++; }