Alternative for delay()

Hello,

Im currently working on a Protein mashine.
i have 2 Potentiometer Inputs (1 for Waterpumpmotor duration and 1 for mixingmotor duration) and 1 start button

I want the 2 Motors to run independently from eachother (Depending on the Potentiometer input)
But with the delay funktion, either both or none run at the same time. I know it somehow works with milis, but i cant get it to run. (Later on i want to use a Steppermotor for the Proteinpowder)
Thanks in advance!
here my code so far.

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Stepper.h>

//----------------Stepper-----------//
const int stepsPerRevolution = 2048;
// Wiring:
// Pin 3 to IN1 on the ULN2003 driver
// Pin 6 to IN2 on the ULN2003 driver
// Pin 8 to IN3 on the ULN2003 driver
// Pin 12 to IN4 on the ULN2003 driver
// Create stepper object called 'myStepper', note the pin order:
Stepper myStepper = Stepper(stepsPerRevolution, 3, 8, 6, 12);
//------------------//

LiquidCrystal_I2C lcd(0x27,16,2);

int motor1_A=11; //WasserPumpe
int motor1_B=10; //

int motor2_A = 4; // Rührer
int motor2_B = 5; //

int buttonStart = 22; //Pushbutton1
int buttonRuehrmotor = 23; //Pushbutton2
int potPinWasser = 7; //Potentiometer
int potPinProtein = 8; //Potentiometer
double val = 0; // variable

// the setup routine runs once when you press reset:
void setup() {
//--------Stepper----------//
// Set the speed to 5 rpm:
myStepper.setSpeed(16);
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
pinMode(motor1_A,OUTPUT);
pinMode(motor1_B,OUTPUT);
// make the pushbutton's pin an input:
pinMode(buttonStart, INPUT);
pinMode(buttonRuehrmotor,INPUT);
pinMode(potPinWasser, INPUT);
pinMode(potPinProtein, INPUT);

lcd.begin();
lcd.backlight();

}

// the loop routine runs over and over again forever:
void loop() {
// read the input pin:
double value = analogRead(7); //Wasserpumpe
int value2 = analogRead(8); //Protein
int buttonStatebuttonStart = digitalRead(buttonStart);
int buttonStatebuttonRuehrmotor = digitalRead(buttonRuehrmotor);
/---------LCD-----------/
//lcd.begin();
//lcd.backlight();
lcd.setCursor(0,0);
lcd.print(value/1705); //Max 0,6 Liter
lcd.print(" Liter");
lcd.setCursor(0,1);
lcd.print(value2/20); //Max 0,6 Liter
lcd.print(" g Protein");

//delay(10000);
//lcd.noBacklight();
//lcd.clear();
/-----------------------------/

if(buttonStatebuttonStart == HIGH){

digitalWrite(motor1_A, HIGH);
digitalWrite(motor1_B,LOW);
digitalWrite(motor2_A, HIGH);
digitalWrite(motor2_B,LOW);
myStepper.step(-stepsPerRevolution);
delay(value*4);
}
if(buttonStatebuttonRuehrmotor == HIGH){

digitalWrite(motor1_A, LOW);
digitalWrite(motor1_B,LOW);
digitalWrite(motor2_A, HIGH);
digitalWrite(motor2_B,LOW);

}
else {
digitalWrite(motor1_A, LOW);
digitalWrite(motor1_B,LOW);
digitalWrite(motor2_A, LOW);
digitalWrite(motor2_B,LOW);
}
Serial.println(buttonStatebuttonStart);
//Serial.println(buttonRuehrmotor);
//Serial.println(value2);
delay(1); // delay in between reads for stability
}

I know it somehow works with milis, but i cant get it to run.

Please read Read this before posting a programming question then follow the instructions and post what you tried

Take a look at Using millis() for timing. A beginners guide, Several things at the same time and the BlinkWithoutDelay example in the IDE

You state you have 1 button, but your code has 2. I will assume there is only 1 button.
What board are you using? Odd that you are doing analogRead() on pins 7 and 8 but I don't know

This should get you close [untested]

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Stepper.h>

//----------------Stepper-----------//
const int stepsPerRevolution = 2048;
// Wiring:
// Pin 3 to IN1 on the ULN2003 driver
// Pin 6 to IN2 on the ULN2003 driver
// Pin 8 to IN3 on the ULN2003 driver
// Pin 12 to IN4 on the ULN2003 driver
// Create stepper object called 'myStepper', note the pin order:
Stepper myStepper = Stepper(stepsPerRevolution, 3, 8, 6, 12);
//------------------//

LiquidCrystal_I2C lcd(0x27, 16, 2);

const int WasserPumpePin_A = 11;  //WasserPumpe
const int WasserPumpePin_B = 10;  //

const int RuhrerPin_A  = 4;  // Rührer
const int RuhrerPin_B  = 5;  //

const int buttonStartPin = 22; //Pushbutton1
//const int buttonRuehrmotorPin = 23; //Pushbutton2
const int potPinWasser = 7;     //Potentiometer
const int potPinProtein = 8;     //Potentiometer

const float stepsPerGram = 40.0;  // number of steps for 1 gram of Protein

int previousStartState;

unsigned long startTime;
const unsigned long wasserDuration = 1000;  // milliseconds
const unsigned long ruhrerDuration = 1500;  // milliseconds

// the setup routine runs once when you press reset:
void setup() {
  //--------Stepper----------//
  // Set the speed to 5 rpm:
  myStepper.setSpeed(16);
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  pinMode(WasserPumpePin_A, OUTPUT);
  pinMode(WasserPumpePin_B, OUTPUT);
  // make the pushbutton's pin an input:
  pinMode(buttonStartPin, INPUT);
  //  pinMode(buttonRuehrmotorPin, INPUT);
  pinMode(potPinWasser, INPUT);
  pinMode(potPinProtein, INPUT);

  lcd.begin();
  lcd.backlight();
  previousStartState = digitalRead(buttonStartPin);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input pin:
  int wasserValue = analogRead(potPinWasser);   //Wasserpumpe
  int proteinValue = analogRead(potPinProtein);  //Protein
  int startState = digitalRead(buttonStartPin);
  //  int ruehrmotorState = digitalRead(buttonRuehrmotorPin);

  float wasserAmount = wasserValue / 1705.0;  // liters of water
  float proteinAmount = proteinValue / 20.0;  // grams of protein

  lcd.setCursor(0, 0);
  lcd.print(wasserAount, 2); //Max 0,6 Liter
  lcd.print("  Liter");
  lcd.setCursor(0, 1);
  lcd.print(proteinAmount, 2);
  lcd.print(" g  Protein");

  // check if motors running
  if ( wasserIsRunning == true ) {
    if ( millis() - startTime >= wasserDuration ) {
      wasserIsRunning = false;
      Serial.println("Wasser Motor OFF");
      digitalWrite(WasserPumpePin_A, LOW);
      digitalWrite(WasserPumpePin_B, LOW);
    }
  }

  if ( ruhrerIsRunning == true ) {
    if ( millis() - startTime >= ruhrerDuration ) {
      ruhrerIsRunning = false;
      Serial.println("Ruhrer Motor OFF");
      digitalWrite(RuhrerPin_A, LOW);
      digitalWrite(RuhrerPin_B, LOW);
    }
  }

  // only check start button if not currently running
  if ( wasserIsRunning == false && ruhrerIsRunning == false ) {
    if ( startState = ! previousStartState ) {
      if (startState == HIGH) {
        // start button pushed, begin sequence
        Serial.println("Beginning sequence");

        // calculate number of steps to equal amount of protein
        int steps = proteinAmount * stepsPerGram;
        Serial.print("Protein steps =");
        Serial.println(steps);
        myStepper.step(-steps);

        startTime = millis();
        wasserIsRunning = true;
        RuhrerIsRunning = true;
        Serial.println("Motors ON");
        digitalWrite(WasserPumpePin_A, HIGH);
        digitalWrite(WasserPumpePin_B, LOW);
        digitalWrite(RuhrerPin_A, HIGH);
        digitalWrite(RuhrerPin_B, LOW);
      }
      delay(25);
    }
  }
  previousStartState = startState;
}