multi statement IF not triggering

Hello, i have an issue with a sketch in which i need to trigger a multi statement if with different operands, but it's not working.

this is the code:

/*
*/

#include "SevSeg.h"
#include "Bounce2.h"
SevSeg sevseg; //Instantiate a seven segment controller object

// Instantiate a Bounce object
Bounce corto = Bounce();
Bounce largo = Bounce();
bool contando = false;
bool contando_inicial = false;
unsigned long previousMillis = 0;

void setup() {
  byte numDigits = 3;
  byte digitPins[] = {7, 8, 9}; // pines dígitos
  byte segmentPins[] = {0, 1, 2, 3, 4, 5, 6}; //pines segmentos, sin DP
  bool resistorsOnSegments = true; // 'false' means resistors are on digit pins
  byte hardwareConfig = COMMON_CATHODE; // See README.md for options
  bool updateWithDelays = false; // Default 'false' is Recommended
  bool leadingZeros = false; // Use 'true' if you'd like to keep the leading zeros
  bool disableDecPoint = true; // Use 'true' if your decimal point doesn't exist or isn't connected
  sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
               updateWithDelays, leadingZeros, disableDecPoint);
  sevseg.setBrightness(100);
  pinMode(10, OUTPUT); //buzzer
  pinMode(11, INPUT_PULLUP); // largo
  pinMode(12, INPUT_PULLUP); // corto
  corto.attach(11);
  corto.interval(10); // interval in ms
  largo.attach(12);
  largo.interval(10); // interval in ms
  sevseg.setChars("---");

}

void loop() {
  corto.update();
  largo.update();
  int inicial_corto = corto.read();
  int inicial_largo = largo.read();

  unsigned long timer = millis();
  static int secondshort = 120;
  static int secondlong = 240;
  static int secondstart = 10;

if (((inicial_corto == LOW || inicial_largo == LOW) && (contando = false)) || (contando_inicial)) { //arranque
     if (timer - previousMillis >= 1000) { //10s inicio
      previousMillis = timer;
      secondstart--;
      contando_inicial = true;
      if (secondstart == 0) {
        secondstart = 10;
        contando_inicial = false;
        contando = true;
      } else
        sevseg.setNumber(secondstart, 0);

the failing IF is this one:

if (((inicial_corto == LOW || inicial_largo == LOW) && (contando = false)) || (contando_inicial)) {

i've rechecked the code and it should trigger as all requirements are met!. contando and contando_inicial are set to false on creation, both inicial_corto and _largo depend on the button press(and they work ok if i only use them ORed in the IF by themselves), so the IF should trigger as soon as any button is pressed

i've also tested with enclosing the statements in parenthesis with same result

&& (contando = false)

Eliminateur: the failing IF is this one:

if (((inicial_corto == LOW || inicial_largo == LOW) && (contando = false)) || (contando_inicial)) {

i've rechecked the code and it should trigger as all requirements are met!.

Clearly they are not, or you have the () in the wrong place.

I am always wary of complex IF statements because they are very hard to debug

Try writing it like this (which, I think, is the intended logic)

doAction = false;
if (contando_inicial == true) {
 doAction = true;
}
if (contando == false) {
 if (inicial_corto == LOW or inicial_largo == LOW) {
 doAction = true;
 }
}


if (doAction == true) {
 // do the thing
}

...R

PS ... I missed the faulty '=' :)

arduino_new: && (contando = false)

¡¡¡¡¡omg i'm such a muppet!!!!!, i even have equal comparators in the same line before!!!!.

now it works, sort of(well the IF works, now i have to check other stuff haha)