Multiple functions in one loop

There is something wrong with the loop as long as all the following commands are working fine except for the first function which is not carried out. once I remove the other four functions from the loop, the first one works fine, but once I add them back it does not work.

#define ledA1 2
#define ledA2 3
#define ledA3 4

#define ledB1 5
#define ledB2 6
#define ledB3 7

#define ledC1 8
#define ledC2 9
#define ledC3 10

#define ledD1 12
#define ledD2 11
#define ledD3 13
int A = 53; //IR sensor
int white = 51; //LED
int a1, a2, b1, b2, c1, c2, d1, d2;

void setup() {

  Serial.begin(9600);

  pinMode(ledA1, OUTPUT);
  pinMode(ledA2, OUTPUT);
  pinMode(ledA3, OUTPUT);

  pinMode(ledB1, OUTPUT);
  pinMode(ledB2, OUTPUT);
  pinMode(ledB3, OUTPUT);

  pinMode(ledC1, OUTPUT);
  pinMode(ledC2, OUTPUT);
  pinMode(ledC3, OUTPUT);

  pinMode(ledD1, OUTPUT);
  pinMode(ledD2, OUTPUT);
  pinMode(ledD3, OUTPUT);
  pinMode(A, INPUT);
  pinMode(white, OUTPUT);
  



}

void loop() {
  sensor();
  roadBopen();
  roadDopen();
  roadAopen();
  roadCopen();

}


 
void roadAopen()
{
  digitalWrite(ledA3, LOW);

  digitalWrite(ledA1, HIGH);
  digitalWrite(ledB3, HIGH);
  digitalWrite(ledC3, HIGH);
  digitalWrite(ledD3, HIGH);
  delay(10000);
  digitalWrite(ledA1, LOW);
  digitalWrite(ledA2, HIGH);
  delay(1000);
  digitalWrite(ledA2, LOW);
 
}

void roadBopen()
{
  digitalWrite(ledB3, LOW);

  digitalWrite(ledA3, HIGH);
  digitalWrite(ledB1, HIGH);
  digitalWrite(ledC3, HIGH);
  digitalWrite(ledD3, HIGH);
  delay(10000);
  digitalWrite(ledB1, LOW);
  digitalWrite(ledB2, HIGH);
  delay(1000);
  digitalWrite(ledB2, LOW);

}

void roadCopen()
{
  digitalWrite(ledC3, LOW);

  digitalWrite(ledA3, HIGH);
  digitalWrite(ledB3, HIGH);
  digitalWrite(ledC1, HIGH);
  digitalWrite(ledD3, HIGH);
  delay(10000);
  digitalWrite(ledC1, LOW);
  digitalWrite(ledC2, HIGH);
  delay(1000);
  digitalWrite(ledC2, LOW);
 
}

void roadDopen()
{
  digitalWrite(ledD3, LOW);

  digitalWrite(ledA3, HIGH);
  digitalWrite(ledB3, HIGH);
  digitalWrite(ledC3, HIGH);
  digitalWrite(ledD1, HIGH);
  delay(10000);
  digitalWrite(ledD1, LOW);
  digitalWrite(ledD2, HIGH);
  delay(1000);
  digitalWrite(ledD2, LOW);

}

  void sensor()
  {
    int statusSensor = digitalRead (A);
  if (statusSensor == 1)
  {
    digitalWrite(white, LOW);
  }
  else 
  {
    digitalWrite(white, HIGH);
  }
 
  }

Try to imagine that we don’t know what “works” and “doesn’t work” mean.

Now, try again

TheMemberFormerlyKnownAsAWOL:
Try to imagine that we don’t know what “works” and “doesn’t work” mean.

Now, try again

the first function must light up a LED once the sensor detects an object (it works that way)
and the rest represent 4 traffic lights.
so every function is working properly until they’re combined together as it is shown in the code.

Do you think it might have anything do with the huge delays in the other 4 functions which mean it only gets to the first function and reads the sensor about once a minute?

Steve

slipstick:
Do you think it might have anything do with the huge delays in the other 4 functions which mean it only gets to the first function and reads the sensor about once a minute?

Steve

Is there a way to let the function read the sensor continuously without removing the delays, so the it does not affect the concept of the other functions?

Is there a way to let the function read the sensor continuously

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