Stuck in while loop after condition is met

My code needs to wait (and do nothing else) until a digital pin goes high. But even after the pin goes high, the while loop continues to run and the code does not advance.

    while (digitalRead(SLAVE_1 == LOW)) {
        if (digitalRead(SLAVE_1) == LOW) { Serial.println("Low"); }
        else { Serial.println("High"); }
    Serial.println("Slave ready.");

The output from the above loop is a never-ending stream of "High". A DVM also confirms that the pin is, in fact, high. Furthermore, I know that the pin is high even before the while loops starts. What's going on?

while (digitalRead(SLAVE_1 == LOW)) Misplaced ) oops

That code is effectively doing

  while (digitalRead (0))

Since SLAVE_1 != LOW
And since pin 0 is RX pin which is idle HIGH, the condition will be true most of the time.


A couple of hours of my life I'm not getting back. Thanks for catching that.