const int button = 27;//declaration of the "button" constant void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(button, INPUT); pinMode(26, OUTPUT);//Led pinMode(0, OUTPUT);//Led pinMode(1, OUTPUT);//Led pinMode(LED_BUILTIN, OUTPUT); } // the loop function runs over and over again forever void loop() { int statebutton = digitalRead(button);//read whether the knob is in the open or closed position if (statebutton == LOW) {//is used to set a condition digitalWrite(26, HIGH); // turn the LED on (HIGH is the voltage level) digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level) digitalWrite(1, HIGH); // turn the LED on (HIGH is the voltage level) delay(100);//action execution time (in milliseconds) } else{//is used to set a condition digitalWrite(26, LOW); // turn the LED off by making the voltage LOW digitalWrite(0, LOW); // turn the LED off by making the voltage LOW digitalWrite(1, LOW); // turn the LED off by making the voltage LOW Serial.println(statebutton);//displays in the Arduino monitor whether the button is in the open or closed position delay(100);//action execution time (in milliseconds) } }