Arduino while loop with or condition How do I write a program to wait (delay) until one out of two buttons pressed? I have written a program to wait until a single button is pressed. It's working fine. However, if I extend it to second button it's not working. Pls help on this.

while (digitalRead(bt_Select) == HIGH) {} -- working.
while (digitalRead(bt_Select) == HIGH || digitalRead(bt_Reject) == HIGH) {} -- Not working.

Complete code:
const int bt_Select = 2;
const int bt_Reject = 3;

void setup() {
  Serial.begin(9600);  
  pinMode(bt_Select, INPUT_PULLUP);
  pinMode(bt_Reject, INPUT_PULLUP);
}

void loop() {
  Serial.println(&quot;Pl input:&quot;);

  while (digitalRead(bt_Select) == HIGH {} // This is the line I change
      
  if (digitalRead(bt_Select) == LOW) {
    Serial.println(&quot;Select Button pressed:&quot;);
    delay(250);
    Serial.println(&quot;&quot;);
  }

  if (digitalRead(bt_Reject) == LOW) {
    Serial.println(&quot;Reject Button pressed:&quot;);
    delay(250);
    Serial.println(&quot;&quot;);
  }
}
while (digitalRead(bt_Select)==HIGH||digitalRead(bt_Reject)==HIGH){}
should be
while (digitalRead(bt_Select)==HIGH&amp;&amp;digitalRead(bt_Reject)==HIGH){}
The first loop would break only if you press both buttons at once. I believe you are trying to break if either button is pressed.