warning: statement has no effect [solved]

The following sketch is supposed to read the value of a debounced button and light one or two corresponding LEDs. The sketch won’t work, I’ve serial.print()ed it a while and it all seems ok. Turned verbose mode on and the compiler says “warning: statement has no effect” to both marked lines. All functions except one with warning(DUH) have been tested and work. Can’t see what’s wrong.

int WhatLED (int buttoni) {
  if (buttoni >= 0 && buttoni < floors) {
    return buttoni;
  }
  if (buttoni >= floors && buttoni < (floors + functButtons)) {
    return (buttoni + 1);
  }
  if (buttoni >= (floors + functButtons) && buttoni < totalButtons) {
    return (buttoni + 2);
  }
  return -1; //error code
}

void LightLEDs() {
  for (int i = 0; i < totalLEDs; i++) {
    digitalWrite(allLEDs[i], LEDStates[i]);
  }
}

void FollowButtons() {
  ScanButtons();
  Serial.println("Buttons Scanned");
  for (int i = 0; i < totalButtons; i++) {
    if (buttonStates[i] == HIGH) {
      int startLED;
      startLED = WhatLED(i);
      LEDStates[startLED] == HIGH;///////////////////////////////////////////////
      if (i < (floors + functButtons)) {
        LEDStates[(startLED + 1)] == HIGH;/////////////////////////////////////////
      }
    }
  }
    LightLEDs();
}
void ScanButtons() {                                                     //reads all buttons and stores state 
  for (int i = 0; i < totalButtons; i++) {
    buttonStates[i] = debounce(allButtons[i]); 
  }
}
boolean debounce(int pin) {                                              //returns HIGH if button if HIGH for debounceDelay in miliseconds
  previousState = digitalRead(pin);                                      //store pin state
  for (int i = 0; i < debounceDelay; i++) {                              //make sure button is pressed every milisecond debounceDelay times
    delay(1);
    state = digitalRead(pin);
    if (state != previousState) {                                        //reset if change in state
      i = 0;
      previousState = state;
    }
  }
  return state;                                                          //return stable state
}

**Note:**I’ve added complete code as attachment

myUpload.ino (6.97 KB)

LEDStates[startLED] == HIGH;

That is a comparison, the result of which you are discarding. Do you mean:

LEDStates[startLED] = HIGH;

oh god, how could I. No sleep || coffee and I'm useless... :roll_eyes: Thanks a lot.