Need help with error message... trying to convert code to have no delay(); !!!

I've referred to a few topics to get where I am now but now I can't get past this error message of "lvalue required as left operand of assignment". This is a new one for me. I have posted only the relavent lines from sketch. I'm trying to get rid of the delay functions as I now see how cool it would be to not have to use it anymore. In the loop portion of the sketch, my "delayed" code goes like this:

void motorOnThenOffCamTrig(){ 
 int offTime = 1150;
  int camTrigOnTime = 200;
  digitalWrite(motorPin, HIGH),digitalWrite(LEDpin2, HIGH),digitalWrite(LEDpin1, LOW);
  delay(outputValue1);
  digitalWrite(motorPin, LOW),digitalWrite(LEDpin2, LOW),digitalWrite(LEDpin1, HIGH);
  delay(offTime);
  digitalWrite(camPin, HIGH);
  delay(camTrigOnTime);
  digitalWrite(camPin, LOW);
  delay(outputValue2);
 }

... the motor turns on for # of ms mapped from varibale pot 1 (outputValue1), then turns off for 1150 ms, then camera trigger snaps a shot (like a 200ms button push), then motor & camera remain inactive for amount of time set by the 2nd varible pot (outputValue2)(to allow for longer exposures(not bulb mode)).

So having removed delay, I tried to expand my mind and got to this:

  const int motorPin = 11;       // pin for motor on/off
  const int camPin = 10;         // pin for camera trigger relay
  const int pot1Pin = A0;        // Analog input pin for variable pot that controls motor timing (or speed in "video" mode)
  const int pot2Pin = A1;        // Analog input pin for variable pot that controls the camera post-trigger delay(disabled in video mode)
  int sensorValue1 = 0;          // value read from the pot1
  int outputValue1 = 0;          // variable used for motorOn time mapping in milleseconds 
  int sensorValue2 = 0;          // value read from the pot2
  int outputValue2 = 0;          // varible used for cam post-trigger delay time mapped in milleseconds
  int offTime = 1150;
  int camTrigOnTime = 200;
  const int LEDpin1 = 4;         // pin for LED indicating motor off
  const int LEDpin2 = 3;         // pin for LED indicating motor on
  unsigned long previousMillis = 0;
  unsigned long previousMillis2 = 0;
  unsigned long previousMillis3 = 0;
  unsigned long previousMillis4 = 0;
  boolean flag = true;
  boolean flag2 = false;
  boolean flag3 = false;
  boolean flag4 = false;
void setup(){
 pinMode(motorPin, OUTPUT); 
 pinMode(camPin, OUTPUT);
 pinMode(pot1Pin, INPUT);          
 pinMode(pot2Pin, INPUT);
} 
void loop(){  
 unsigned long currentMillis = millis();
  if (currentMillis - previousMillis4 >= outputValue2 && flag = true) {
    previousMillis = currentMillis;
    digitalWrite(motorPin, HIGH),digitalWrite(LEDpin2, HIGH),digitalWrite(LEDpin1, LOW);
    flag = false;
    flag2 = true;
  }
  if (currentMillis - previousMillis >= outputValue1 && flag2 = true) {  
    previousMillis2 = currentMillis;
    digitalWrite(motorPin, LOW),digitalWrite(LEDpin2, LOW),digitalWrite(LEDpin1, HIGH);
    flag2 = false;
    flag3 = true;
  }
  if (currentMillis - previousMillis2 >= offTime && flag3 = true) { 
    digitalWrite(camPin, HIGH);
    previousMillis3 = currentMillis;
    flag3 = false;
    flag4 = true;
  }
  if (currentMillis - previousMillis3 >= camTrigOnTime && flag 4 = true) {
    digitalWrite(camPin, LOW);
    previousMillis4 = currentMillis;
    flag4 = false;
    flag = true;
  }
}

... but now I get that error message previously mentioned.

~Andrew

Moderator edit: code tags added.

some portions of the code are obviously missing like the mapping of variable pots to outputValue's, etc. but all that works fine. just trying to be less wordy.

When posting code, please use "code" tags wrapped around your code. (they look like [ code ]. you can see them when you press the "#" button in the editor.)

"(currentMillis - previousMillis4 >= outputValue2 && flag = true)"

"flag = true" is almost certainly not what you meant. You want to use the comparison operation, not the assignment operatior "flag == true".

Also, use paranthesis to ensure the compiler is doing operations in the order you expect: "( ((currentMillis - previousMillis4) >= outputValue2) && (flag == true) )"

ah yes! of course… thank you. It happily compiles now… now I see if it works…

This does indeed work! thanks for the schooling!

just for the record... here's the corrected code:

void loop(){  
 unsigned long currentMillis = millis();
  if (currentMillis - previousMillis4 >= outputValue2 && flag == true) {
    previousMillis = currentMillis;
    digitalWrite(motorPin, HIGH),digitalWrite(LEDpin2, HIGH),digitalWrite(LEDpin1, LOW);
    flag = false;
    flag2 = true;
  }
  if (currentMillis - previousMillis >= outputValue1 && flag2 == true) {  
    previousMillis2 = currentMillis;
    digitalWrite(motorPin, LOW),digitalWrite(LEDpin2, LOW),digitalWrite(LEDpin1, HIGH);
    flag2 = false;
    flag3 = true;
  }
  if (currentMillis - previousMillis2 >= offTime && flag3 == true) { 
    digitalWrite(camPin, HIGH);
    previousMillis3 = currentMillis;
    flag3 = false;
    flag4 = true;
  }
  if (currentMillis - previousMillis3 >= camTrigOnTime && flag4 == true) {
    digitalWrite(camPin, LOW);
    previousMillis4 = currentMillis;
    flag4 = false;
    flag = true;
  }
}