Hello everyone, I am trying to create a washing machine in TinkerCAD, as shown in the image below.

Heres the code:
//Project 02 - Washing Machine - BASIC
//This program will simulate the cycle of a washing machine
//using LEDs, including heavy duty mode
//declare constants for PINS
const int doorSwitch_PIN = 2;
const int stopPB_PIN = 3;
const int rinsePB_PIN = 4;
const int washPB_PIN = 5;
const int heavyDutyPB_PIN = 6;
const int doneLED_PIN = 8;
const int rinseLED_PIN = 9;
const int washLED_PIN = 10;
const int heavyDutyLED_PIN = 11;
const int readyLED_PIN = 12;
const int washcycletime = 5000;
const int rinsecycletime = 3000;
int mode = 0; //mode 0 = Standby
//mode 1 = Ready to Start
//mode 2 = Wash
//mode 3 = Rinse
//mode 4 = Cycle Complete
//mode 5 = Heavy Duty
void setup()
{
//set pins as inputs and outputs
pinMode(doorSwitch_PIN, INPUT);
pinMode(stopPB_PIN, INPUT);
pinMode(rinsePB_PIN, INPUT);
pinMode(washPB_PIN, INPUT);
pinMode(doneLED_PIN, OUTPUT);
pinMode(rinseLED_PIN, OUTPUT);
pinMode(washLED_PIN, OUTPUT);
pinMode(readyLED_PIN, OUTPUT);
}
void loop()
{
//read button states
bool doorState = digitalRead(doorSwitch_PIN);
bool stopPBState = digitalRead(stopPB_PIN);
bool rinsePBState = digitalRead(rinsePB_PIN);
bool washPBState = digitalRead(washPB_PIN);
bool heavyDutyPBState = digitalRead(heavyDutyPB_PIN);
switch (mode)
{
case 0: //standby
//set LEDs
digitalWrite(readyLED_PIN, LOW);
digitalWrite(heavyDutyLED_PIN, LOW);
digitalWrite(washLED_PIN, LOW);
digitalWrite(rinseLED_PIN, LOW);
digitalWrite(doneLED_PIN, LOW);
//if door is closed start ready mode
if (doorState == LOW)
{
mode = 1;
}
break;
case 1: //ready to start
//set LEDs
digitalWrite(readyLED_PIN, HIGH);
digitalWrite(heavyDutyLED_PIN, LOW);
digitalWrite(washLED_PIN, LOW);
digitalWrite(rinseLED_PIN, LOW);
digitalWrite(doneLED_PIN, LOW);
//if door is opened start standby mode
if (doorState == HIGH)
{
mode = 0;
}
//if heavy duty button is pressed start heavy duty mode
if (heavyDutyPBState == LOW)
{
mode = 5;
}
//if wash button is pressed start wash mode
if (washPBState == LOW)
{
mode = 2;
}
//if rinse button is pressed start rinse mode
if (rinsePBState == LOW)
{
mode = 3;
}
break;
case 2: //regular wash
//set LEDs
digitalWrite(readyLED_PIN, LOW);
digitalWrite(heavyDutyLED_PIN, LOW);
digitalWrite(washLED_PIN, HIGH);
digitalWrite(rinseLED_PIN, LOW);
digitalWrite(doneLED_PIN, LOW);
//complete cycle then start rinse mode
delay(washcycletime);
mode = 3;
break;
case 3: //rinse
//set LEDs
digitalWrite(readyLED_PIN, LOW);
digitalWrite(heavyDutyLED_PIN, LOW);
digitalWrite(washLED_PIN, LOW);
digitalWrite(rinseLED_PIN, HIGH);
digitalWrite(doneLED_PIN, LOW);
//complete cycle then start cycle complete mode
delay(rinsecycletime);
mode = 4;
break;
case 4: //cycle complete
//set LEDs
digitalWrite(readyLED_PIN, LOW);
digitalWrite(heavyDutyLED_PIN, LOW);
digitalWrite(washLED_PIN, LOW);
digitalWrite(rinseLED_PIN, LOW);
digitalWrite(doneLED_PIN, HIGH);
//if door is opened or stop button is pressed start standby mode
if ((doorState == HIGH) || (stopPBState == LOW))
{
mode = 0;
}
break;
case 5: //heavy duty
//set LEDs
digitalWrite(readyLED_PIN, LOW);
digitalWrite(heavyDutyLED_PIN, HIGH);
digitalWrite(washLED_PIN, LOW);
digitalWrite(rinseLED_PIN, LOW);
digitalWrite(doneLED_PIN, LOW);
//complete cycle then start rinse mode
delay(washcycletime*2);
mode = 3;
break;
}
delay(10);
}
Now what I need to do is find a way for the stop button and door switch to work at any time during the wash or rinse cycles. The version you're seeing right now doesn't do that sadly. One person told me to look at the "Blink Without Delay" in Arduino Starter, but that doesn't seem to be giving me any hints at all. I greatly appreciate any help that you can provide me, thanks!