Code does IF statement even when IF statement isnt true?

I won't switch it again though. Sorry!

Did you change logic state?
You changed to pull-upped switch.

I said in #13.

  // check if the pushbutton is pressed. pressed = LOW , not pressed = HIGH
  if (buttonState == LOW) 

Follow @jremington posts image.

Yes I have it at LOW.

Okay, Let's post a code and photo of the final setup.

Ok here's an update on how everything looks. Thanks guys!!

enum DIR_ENUM {
  DIR_UP = 0, // Black
  DIR_DN,     // Blue
  DIR_LT,     // Yellow
  DIR_RT,     // Green
  DIR_CNT
};
const int buttonPin = 3;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

int buttonState = 0;         // variable for reading the pushbutton status

int DirectionPin[DIR_CNT] = {10, 8, 6, 4};
int OppositesPin[DIR_CNT] = {8, 10, 4, 6};
int Steps [100][2];
int Accumulation [DIR_CNT][2];

int Purple = 12;
boolean running = 1;


void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
Steps[0][0] = DIR_UP;
Steps[0][1] = 2000; //delay for 2 seconds
Steps[1][0] = DIR_DN;
Steps[1][1] = 2000;
Steps[2][0] = DIR_LT;
Steps[2][1] = 4000;
Steps[3][0] = DIR_RT;
Steps[3][1] = 4000;

// initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT_PULLUP);

}

void loop() {



  // put your main code here, to run repeatedly:
                  
                 if (running) 
                 {
                  digitalWrite(ledPin, LOW);

                 
                  //UP
                  Serial.println("UP");
                  digitalWrite(DirectionPin[Steps[0][0]], HIGH);    // Go UP for 2 seconds
                  delay(Steps[0][1]);
                  digitalWrite(DirectionPin[Steps[0][0]], LOW);
                 
                  //DOWN
                  Serial.println("DOWN");
                  digitalWrite(DirectionPin[Steps[1][0]], HIGH);    // Go DOWN for 2 seconds
                  delay(Steps[1][1]);
                  digitalWrite(DirectionPin[Steps[1][0]], LOW);
                  
                  //LEFT
                  Serial.println("LEFT");
                  digitalWrite(DirectionPin[Steps[2][0]], HIGH);    // Go LEFT for 4 seconds
                  delay(Steps[2][1]);
                  digitalWrite(DirectionPin[Steps[2][0]], LOW);
                  
                  //RIGHT
                  Serial.println("RIGHT");
                  digitalWrite(DirectionPin[Steps[3][0]], HIGH);    // Go RIGHT for 4 seconds
                  delay(Steps[3][1]);
                  digitalWrite(DirectionPin[Steps[3][0]], LOW);
                  
                  }

                  

  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (buttonState == LOW) 
  
  {
    Serial.println("abort");
    digitalWrite(ledPin, HIGH);
    running = 0;

  } 


  
   }


It certainly looks like the button is connected along one edge and not at opposite corners on the diagonal.

What do you think diagonal means? What is your primary language?

*UPDATE... this still doesn't work.

Capture

See varesano.net -

Sigh... so my breadboard is still wrong?! crying

Setup looks like good, unless the parts are defective.

What happens when program this code and press a button-switch while looking at the serial monitor?
Is it working properly?

const int buttonPin = 3;
void setup() {
  Serial.begin(9600);
  pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
  if (digitalRead(buttonPin) == LOW) {
    Serial.println("PRESSED!");
  } else {
    Serial.println("RELEASED...");
  }
  delay(100);
}

Does the button press not cause the "abort" to be printed, or
does it still randomly trigger the "abort" and the led?

Have you tried a simple digitalRead() sketch with pin3 to see what your read pressed and unpressed?

Try some new leads, they can be defective.

It only says pressed while I am pressing it.

It's works fine!? :thinking:

What's wrong with running your code?

It no longer randomly triggers abort, but abort only prints while I'm holding the button down and the loop is finished.

It's normal.
You are using a delay() in your codes...

I dont know sigh... maybe I should try rebooting my computer. I am not sure what's going on.

Non non non!

The delay() means pause Arduino.
During that time, basically no code is being executed.
The state of the button is only checked at the end of the loop.

This is normal behavior.

Change to a code that doesn't use delay(), or use the interrupts to abort-button with the delay() left.
(Well, the latter can be criticized by other posters.)

Gotcha. Well I guess the only problem that remains is that I have to hold it down. Not sure why that is.

Thanks you guys for your help! I will keep working on this to figure it out.

Your code contains a total delay of 12 seconds.
That is, one loop runs in about 12 seconds.
The button is checked only once at the end of the loop, so I'm only checking if it's pressed once every 12 seconds.
Unless you pressed it at that timing, it will not recognize that it is being pressed.