Sequencing LED's lvalue required as left operand of assignment

Hello

I am trying to drive 3 led’s as if I were using a 555 and a decade counter without using delays (I have strobes and switch functions to perform at the same time).

On coding I keep getting the lvalue required as left operand of assignment on the 3 If functions that drive the leds.

// constants

int warpled1 = 5;
int warpled2 = 6;
int warpled3 = 7;

int warpflashInterval = 250;    // how long each warp LED is lit

// -------- Variables

byte warpled1State = LOW;
byte warpled2State = LOW;
byte warpled3State = LOW;


unsigned long currentMillis = 0;
unsigned long previouswarptime1 = 0;
unsigned long previouswarptime2 = 0;
unsigned long previouswarptime3 = 0;

void setup() {
  pinMode(warpled1, OUTPUT);
  pinMode(warpled2, OUTPUT);
  pinMode(warpled3, OUTPUT);

void loop() {
  currentMillis = millis();
  if (currentMillis < 10) {warpled3State = HIGH;} // Will one shot before 10 milliseconds to set of LED 3

  warp();
void warp() {
if ( warpled1State = LOW && warpled2State = LOW  && warpled3State = HIGH  && currentMillis-previouswarptime3 >= warpflashInterval ){
  digitalWrite(warpled1, HIGH);
  warpled1State = HIGH;
  digitalWrite(warpled3, LOW);
  warpled3State = LOW;
  previouswarptime1 = currentMillis;}

if ( warpled1State = HIGH && warpled2State = LOW  && warpled3State = LOW  && currentMillis-previouswarptime1 >= warpflashInterval ){
  digitalWrite(warpled2, HIGH);
  warpled2State = HIGH;
  digitalWrite(warpled1, LOW);
  warpled1State = LOW;
  previouswarptime2 = currentMillis;}

  if ( warpled1State = LOW && warpled2State = HIGH  && warpled3State = LOW  &&  currentMillis-previouswarptime2 >= warpflashInterval ){
  digitalWrite(warpled3, HIGH);
  warpled3State = HIGH;
  digitalWrite(warpled2, LOW);
  warpled1State = LOW;
  previouswarptime3 = currentMillis;}

}

You are missing the close brace on the setup routine

sorry, it was a copy from the program omitting the other bits, the setup is actually

// the setup routine runs once when you press reset:
void setup() {
  // declare pin 9 to be an output:
  pinMode(photonled, OUTPUT);
  pinMode(saucerled, OUTPUT);
  pinMode(photonswitch, INPUT);

  pinMode(warpled1, OUTPUT);
  pinMode(warpled2, OUTPUT);
  pinMode(warpled3, OUTPUT);
  pinMode(warpstrobe, OUTPUT);
}

ok, in that case you are missing the close brace on the loop routine.

Don't just paste code snippets. Copy and paste the code as it is from the ide.

And 'if' is a statement, not a function.

Pete

I was shortening the code and snippeting as the rest is neither relevant or problematic. I have written each sub program then verified. I have just taken all the subs out leaving only the timer

// Constants

int warpled1 = 5;
int warpled2 = 6;
int warpled3 = 7;

int warpflashInterval = 250;    // how long each warp LED is lit

// -------- Variables

byte warpled1State = LOW;
byte warpled2State = LOW;
byte warpled3State = LOW;

unsigned long currentMillis = 0;

unsigned long previouswarptime1 = 0;
unsigned long previouswarptime2 = 0;
unsigned long previouswarptime3 = 0;


// the setup routine runs once when you press reset:
void setup() {
  pinMode(warpled1, OUTPUT);
  pinMode(warpled2, OUTPUT);
  pinMode(warpled3, OUTPUT);
 
}

// the loop routine runs over and over again forever:

void loop() {
  currentMillis = millis();
  if (currentMillis < 10) {warpled3State = HIGH;}

  warp();
}

// sub progams

void warp() {
if ( warpled1State = LOW && warpled2State = LOW  && warpled3State = HIGH  && currentMillis-previouswarptime3 >= warpflashInterval ){
  digitalWrite(warpled1, HIGH);
  warpled1State = HIGH;
  digitalWrite(warpled3, LOW);
  warpled3State = LOW;
  previouswarptime1 = currentMillis;}

if ( warpled1State = HIGH && warpled2State = LOW  && warpled3State = LOW  && currentMillis-previouswarptime1 >= warpflashInterval ){
  digitalWrite(warpled2, HIGH);
  warpled2State = HIGH;
  digitalWrite(warpled1, LOW);
  warpled1State = LOW;
  previouswarptime2 = currentMillis;}

  if ( warpled1State = LOW && warpled2State = HIGH  && warpled3State = LOW  &&  currentMillis-previouswarptime2 >= warpflashInterval ){
  digitalWrite(warpled3, HIGH);
  warpled3State = HIGH;
  digitalWrite(warpled2, LOW);
  warpled1State = LOW;
  previouswarptime3 = currentMillis;}
  
}

Having had a few more coffees and some dinner I think the if was too much, having modified it to just look at the previous led state bit and the time calculation not the other 2 bits the program verifies, it had nothing to do with braces.

if ( warpled1State = HIGH && warpled2State = LOW  && warpled3State = LOW  &&

Read up on = vs. ==.

ahhh, that explains it,
kept looking at the == and = but its been a while since i programmed and only 3 days since i picked it up again,

thanks