const int buttonPin = A2; //define button locations const int ledPin = A7; //define LED location int buttonState = 0; //button state defined as low to start int count = 0; //set up a counter to change the LED state void setup() { pinMode(ledPin, OUTPUT); //set LED as output pinMode(buttonPin, INPUT); //set button as an input } void loop() { buttonState = digitalRead(buttonPin); //read state of button //Blink option: if (buttonState == HIGH && count ==0){ //if button is off and you're on state1 digitalWrite(ledPin,LOW); delay(100); digitalWrite(ledPin,HIGH); delay(100); } //Solid option: else if (buttonState == HIGH && count ==1){ digitalWrite(ledPin,HIGH); } //When button is pressed: else{ digitalWrite(ledPin,LOW); count = count +1; if (count >1){ count=0; } else{ } } }