Deactivate pushbuttons at initial stage Pl someone answer my question. I have 4 pushbuttons namely add/reject/start &amp; finish. I want to
1.Deactivate add/reject buttons at initial stage until start button pressed &amp;
2.Once add/reject activated, again should deactivate once finish button pressed &amp;
3.Again if start button pressed, add/reject should be released.
with following code I able to do 2 &amp; 3. However I still lack at 1.pl help on this.
const int bt_Select = 2; // #define BUTTON_PIN 2
const int bt_Reject = 3;
const int bt_Start = 7;
const int bt_Finish = 8;

boolean decision=false;


int bt_Select_state=0;
int bt_Reject_state=0;
int bt_Start_state;
int bt_Finish_state;

int selected;
int rejected;
int started;
int finished;

void setup() {
  // put your setup code here, to run once:
    Serial.begin(9600);  
    pinMode(bt_Select, INPUT_PULLUP);
    pinMode(bt_Reject, INPUT_PULLUP);
    pinMode(bt_Finish, INPUT_PULLUP);
    pinMode(bt_Start, INPUT_PULLUP);
    Serial.println(&quot;Welcome to Nano&quot;);
    delay(1000);
  }
//========================================================================
      void loop() {
        
        started=bt_Start_pressed();     
        selected =bt_Select_pressed();  
        rejected=bt_Reject_pressed();
        finished=bt_Finish_pressed();
        decision=Stop_Main();
    
          int x=0;
          int Lx=0;
  
       if (selected&amp;&amp;decision){x=1;}
       if (rejected&amp;&amp;decision){x=2;}
        if (started&amp;&amp;decision){x=3;}
        
       if (x!=Lx){
        switch(x) {
          case 1:Serial.println(&quot;Selected&quot;);delay(250);Serial.print(&quot;&quot;);
                 break;
          case 2:Serial.println(&quot;Rejected&quot;);delay(250);Serial.print(&quot;&quot;);
                 break;
          case 3:Serial.println(&quot;Started&quot;);delay(250);Serial.print(&quot;&quot;);
                 break;
         
          /*case 3://do something when var equals 1
                 Serial.println(&quot;Removed&quot;);
                 break; */
             }//switch(x)
                 x=Lx;
      }//eof  if (x!=Lx)
    
      }
//====================================================================
      int bt_Select_pressed(){
         bt_Select_state=digitalRead(bt_Select);
           if (bt_Select_state == LOW){return 1;}
           else {return 0;}
      }    
//====================================================================
      int bt_Reject_pressed(){
         bt_Reject_state=digitalRead(bt_Reject);
          if (bt_Reject_state == LOW){return 1;}
          else {return 0;}
           }
//====================================================================
    int bt_Start_pressed(){
         bt_Start_state=digitalRead(bt_Start);
          if (bt_Start_state == LOW){return 1;}
          else{return 0;}
            }
//====================================================================
      int bt_Finish_pressed(){
        bt_Finish_state=digitalRead(bt_Finish);
          if (bt_Finish_state == LOW){return 1;}
          else {return 0;}          
      }
//=====================================================================

      boolean Stop_Main(){
        bt_Start_state=digitalRead(bt_Start);
        bt_Finish_state=digitalRead(bt_Finish);
       
        if (bt_Finish_state == LOW){decision=false;return decision;}
        if (bt_Start_state == LOW){decision=true; return decision;}
               
       // else if (bt_Start_state ==HIGH  &amp;&amp; bt_Finish_state == HIGH){decision=false;return decision;}
          }
  
/*  boolean bt_Start_pressed(){
         bt_Start_state=digitalRead(bt_Start);
          if (bt_Start_state == LOW){started=true; return decision;}
          else{started=false; return decision;}
            }   */  
    //===================
Keep a boolean that begins as false. Set it to true when the start button is pressed, and set it to false again when the finish button is pressed. Then you can read and respond to the add and reject buttons only if that boolean is true, and otherwise ignore them.