Escape Room Wire Cut

Hello!

I would like to make an escape room, and for one of the stages, I want to have a wire cut stage. Five wires have to be cut in the right order, and if the right wire is cut, it will trigger a green LED, and a red LED if the wrong wire is cut. I'm having some trouble with this and it just turns on all the green LEDs and the red LED. Why does this happen?

Code: Github Gist https://gist.github.com/physiks2017/75b71a72f31e69e30eb80717dd0e3841

Code I think is problematic:

    while (one == true)
    {
        // see if all of the wires are connected
        if (digitalRead(bluePin == HIGH))
        {

            // turn on the green LED
            digitalWrite(gled1Pin, HIGH);

            // see if rest of wires are connected
            if (digitalRead(orangePin == HIGH))
            {

                // turn on second green LED
                digitalWrite(gled2Pin, HIGH);

                if (digitalRead(greenPin == HIGH))
                {

                    // turn third LED on
                    digitalWrite(gled3Pin, HIGH);

                    // see if rest of wires are connected
          if (digitalRead(whitePin == HIGH))
                    {

                        // turn on fourth LED
                        digitalWrite(gled4Pin, HIGH);

                        // see if the rest of the wires are connected
                        if (digitalRead(yellowPin == HIGH))
                        {

                            // turn on last green LED
                            digitalWrite(gled5Pin, HIGH);

                            // pause three seconds
                            delay(3000);

                            // turn off green LEDs
                            digitalWrite(bled1Pin, LOW);
                            digitalWrite(bled2Pin, HIGH);
                            digitalWrite(gled1Pin, LOW);
                            digitalWrite(gled2Pin, LOW);
                            digitalWrite(gled3Pin, LOW);
                            digitalWrite(gled4Pin, LOW);
                            digitalWrite(gled5Pin, LOW);
                            two = true;
                            one = false;
pinMode (orangePin, INPUT_PULLUP);
    pinMode (yellowPin, INPUT_PULLUP);
    pinMode (whitePin, INPUT_PULLUP);
pinMode (greenPin, INPUT_PULLUP);

My Wires are connected straight from ground and the pull ups are enabled, since I assumed that when they were cut they would read HIGH

Please post your code here (using code tags, the </> button in upper left), not via link (which isn't even clickable, because you didn't bother using the link button) to an outside site.

Also note how you've connected these wires.

Sorry about that.

Thank you for the tip, I edited the code

Wiring sounds right.

You are setting pinmode for the blue wire to OUTPUT instead of INPUT_PULLUP.

Your digitalReads in the tests are all wrong. You have things like this:

digitalRead(whitePin == HIGH)

Now, that will check whether the variable whitePin (which you've defined as 24) is equal to HIGH (which is defined by the core as 1). That will always be false - 1 is never 24. So that evaluates to digitalRead(0), and that will almost always be HIGH (which evaluates to true - pins 1 and 0 will almost always be high, since they're the serial pins, and an idle serial line is held high).
What you meant to do was:

digitalRead(whitePin)==HIGH

Read the value on whitePin, and compare it with HIGH.

As it happens, you don't actually need to compare with HIGH

if(digitalRead(whitePin)) {
...
}

is fine - HIGH is 1, LOW is 0, and any non-zero value is treated as true.

Also, I may be missing it, but it looks like you're not doing anything to check the order in which the wires are cut - you're checking (in order) whether individual wires are cut, but not whether they were cut in the right order.

Sorry for not responding!

Thank you so much for everything, the code seems to work now!