problem withe program and buuton start and stop

Hello everyone

this is my project and i want build good system for washing machine step by step ...
i don't know what is the problem with my program start and stop :o

this is link for AUTODESK TINKERCAD online simulation project you can uset the project and edit COD

const int startPin = 2;      // Start button pin
const int stopPin = 4;       // Stop button pin
const int doorPin =  13;     // 
const int solenoidPin =  12; //
const int rmotorPin =  11;   //
const int lmotorPin =  10;    //
const int drainPin =  9;     //
const int buzzer = 8;        // buzzer pin 


void setup() {
  //  initialize the pin as output:
  pinMode(doorPin, OUTPUT); 
  pinMode(solenoidPin, OUTPUT); 
  pinMode(rmotorPin, OUTPUT); 
  pinMode(lmotorPin, OUTPUT); 
  pinMode(drainPin, OUTPUT); 
  //  buzzer to arduino pin 7
  pinMode(buzzer, OUTPUT); 
  //  pushbutton pin as an input:
  pinMode(startPin, INPUT_PULLUP);     
  pinMode(stopPin, INPUT_PULLUP); 
}

void loop(){
  
  int startPin = digitalRead(2); //  variable
  int stopPin = digitalRead(4);  //  variable
    
  
  
  if(startPin == HIGH) {
     digitalWrite(doorPin, HIGH);  // DOOR LOCK ON
    delay(1000);
    digitalWrite(solenoidPin, HIGH);  // solenoid ON
    delay(1000);
    digitalWrite(solenoidPin, LOW);  // solenoid OFF
    delay(1000);
    digitalWrite(rmotorPin, HIGH);  // Motor turn right ON
    delay(2000);
    digitalWrite(rmotorPin, LOW);  // Motor turn right OFF
    delay(1000);
    digitalWrite(lmotorPin, HIGH);  // Motor turn left ON
    delay(2000);
    digitalWrite(lmotorPin, LOW);  // Motor turn left OFF
    delay(1000);
    digitalWrite(drainPin, HIGH);  // Drain Watter ON
    delay(2000);
    digitalWrite(drainPin, LOW);  // Drain Watter OFF
    delay(1000);
    digitalWrite(solenoidPin, HIGH);  // solenoid ON
    delay(1000);
    digitalWrite(solenoidPin, LOW);  // solenoid OFF
    delay(1000);
    digitalWrite(rmotorPin, HIGH);  // Motor turn right ON
    delay(2000);
    digitalWrite(rmotorPin, LOW);  //  Motor turn right ON
    delay(1000);
    digitalWrite(lmotorPin, HIGH);  // Motor turn left ON
    delay(2000);
    digitalWrite(lmotorPin, LOW);  // Motor turn left OFF
    delay(1000);
    digitalWrite(drainPin, HIGH);  // Drain Watter ON
    delay(2000);
    digitalWrite(drainPin, LOW);  // Drain Watter OFF
    delay(1000);
    tone(buzzer, 1000);          // Send 1KHz sound signal...
    delay(1000);                 // ...for 1 sec
    noTone(buzzer);              // Stop sound...
    delay(100);                  // ...for 1sec
      
    digitalWrite(doorPin, LOW);  // DOOR LOCK OFF
    delay(1000);
  } 
   if(stopPin == HIGH)  {
     digitalWrite(doorPin, LOW);  // OFF
     digitalWrite(solenoidPin, LOW);  // OFF
     digitalWrite(rmotorPin, LOW);  // OFF
     digitalWrite(lmotorPin, LOW);  // OFF
     digitalWrite(drainPin, LOW);  // OFF
     delay(100);
  }
}

Just some thoughts:

During the 25 seconds or so after pressing the "Start" button, you will not be able to read the "Stop" button.

Look up millis() instead of delay() and state machines.

Look up the pinMode INPUT_PULLUP

LOGANTN:
this is link for AUTODESK TINKERCAD online simulation project you can uset the project and edit COD

I would be very surprised if anyone has the time or inclination to do that.

You need to tell us exactly what your program does and what you want it to do that is different.

Please make your image visible in your Post. See this Simple Image Guide

...R

HI

I want really asking How to stop execution of a sketch arduino withe button stop and start from the beginning

thnx

http://www.thebox.myzen.co.uk/Tutorial/State_Machine.html

LOGANTN:
I want really asking How to stop execution of a sketch arduino withe button stop and start from the beginning

I would be very surprised if the code for a washing machine is that simple.

However if you want to control a block of code with a button then put the code in a function; use the button to set a variable to 'S' for stop or 'R' for run and call the function when the variable contains an 'R'.

See Planning and Implementing a Program

...R