const int buttonPin = 27; // the number of the pushbutton pin const int ledpin_1 = 26; // the number of the LED pin // variables will change: int buttonState = 0; // variable for reading the pushbutton status bool pressed; void setup() { Serial.begin(9600); pinMode(ledpin_1, OUTPUT); pinMode(buttonPin, INPUT); Serial.println("this is an LED example Board for FAB24"); } void loop() { buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { if (pressed == false) { Serial.println("button is pressed"); pressed = true; if (digitalRead(ledpin_1) == LOW) { Serial.println("LED is ON"); digitalWrite(ledpin_1, HIGH); } else {Serial.println("LED is OFF"); digitalWrite(ledpin_1, LOW); } } } else { pressed = false; delay(50); } }