// Set the color of the LED int LED_PIN = 8; //2 = blue, 3 = green, 8 = red // Set Button pin and state int BUTTON_PIN = 7; int BUTTON_STATE = 0; // the setup function runs once when you press reset or power the board void setup(){ pinMode(LED_PIN,OUTPUT); pinMode(BUTTON_PIN,INPUT_PULLUP); } void loop() { BUTTON_STATE = digitalRead(BUTTON_PIN); // put your main code here, to run repeatedly: if (BUTTON_STATE == HIGH){ digitalWrite(LED_PIN,HIGH); } else{ digitalWrite(LED_PIN,LOW); } }