Need help with the code , please.

My project is of 4 way traffic controller with pedestrian button.
The code I am using is this

int Lane1 = {13,12,11}; // Lane 1 Red, Yellow and Green
int Lane2 = {10,9,8};// Lane 2 Red, Yellow and Green
int Lane3 = {7,6,5};// Lane 3 Red, Yellow and Green
int Lane4 = {4,3,2};// Lane 4 Red, Yellow and Green
const int analogPin = A0; // pin that the sensor is attached to
unsigned long changeTime;

const int threshold = 400;
void setup()
{
for (int i = 0; i < 3; i++)
{
pinMode(Lane1*, OUTPUT);*
_ pinMode(Lane2*, OUTPUT);_
_ pinMode(Lane3, OUTPUT);
pinMode(Lane4, OUTPUT);
}
for (int i = 0; i < 3; i++)
{
digitalWrite(Lane1, LOW);
digitalWrite(Lane2, LOW);
digitalWrite(Lane3, LOW);
digitalWrite(Lane4, LOW);
}
}
void loop()
{
stable();
int analogValue = analogRead(analogPin);
// if the analog value is high enough, turn on the LED:
if (analogValue > threshold&&(millis() - changeTime) > 1000) {
pedestrian() ;
}
}
void stable()
{
digitalWrite(Lane1[2], HIGH);
digitalWrite(Lane3[0], HIGH);
digitalWrite(Lane4[0], HIGH);
digitalWrite(Lane2[0], HIGH);
delay(7000);
digitalWrite(Lane1[2], LOW);
digitalWrite(Lane3[0], LOW);
digitalWrite(Lane1[1], HIGH);
digitalWrite(Lane3[1], HIGH);
delay(3000);
digitalWrite(Lane1[1], LOW);
digitalWrite(Lane3[1], LOW);
digitalWrite(Lane1[0], HIGH);
digitalWrite(Lane3[2], HIGH);
delay(7000);
digitalWrite(Lane3[2], LOW);
digitalWrite(Lane4[0], LOW);
digitalWrite(Lane3[1], HIGH);
digitalWrite(Lane4[1], HIGH);
delay(3000);
digitalWrite(Lane3[1], LOW);
digitalWrite(Lane4[1], LOW);
digitalWrite(Lane3[0], HIGH);
digitalWrite(Lane4[2], HIGH);
delay(7000);
digitalWrite(Lane4[2], LOW);
digitalWrite(Lane2[0], LOW);
digitalWrite(Lane4[1], HIGH);
digitalWrite(Lane2[1], HIGH);
delay(3000);
digitalWrite(Lane4[1], LOW);
digitalWrite(Lane2[1], LOW);
digitalWrite(Lane4[0], HIGH);
digitalWrite(Lane2[2], HIGH);
delay(7000);
digitalWrite(Lane1[0], LOW);
digitalWrite(Lane2[2], LOW);
digitalWrite(Lane1[1], HIGH);
digitalWrite(Lane2[1], HIGH);
delay(3000);
digitalWrite(Lane2[1], LOW);
digitalWrite(Lane1[1], LOW);
}
void pedestrian()
{
digitalWrite(13,HIGH);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,HIGH);
digitalWrite(9,LOW);
digitalWrite(8,LOW);
digitalWrite(7,HIGH);
digitalWrite(6,LOW);
digitalWrite(5,LOW);
digitalWrite(4,HIGH);
digitalWrite(3,LOW);
digitalWrite(2,LOW);*_

* delay(4000);*

* digitalWrite(13,LOW);*
* digitalWrite(12,HIGH);*
* digitalWrite(11,LOW);*
* digitalWrite(10,HIGH);*
* digitalWrite(9,LOW);*
* digitalWrite(8,LOW);*
* digitalWrite(7,HIGH);*
* digitalWrite(6,LOW);*
* digitalWrite(5,LOW);*
* digitalWrite(4,LOW);*
* digitalWrite(3,HIGH);*
* digitalWrite(2,LOW); *
* delay(250);*
* changeTime = millis();*
}
Just igonre the timing part, help me with the use of millis() and pedestrian button ?
My pedestrian part only if my switch is like ON for that checking moment,If the button is pressed before it doesn’t run
please help me with the code

The compiler
hates italics,
as do we.
Please edit
your post
and add the
code tags
you forgot.

The best way to fix your problem is to get rid of all those calls to delay()

The demo Several Things at a Time illustrates the use of millis() to manage timing without blocking. It may help with understanding the technique.

You should also learn about FOR loops so that you could shorten your code like this

for (byte n = 13; n >= 2 ; n -= 2) {
   digitalWrite(n, LOW);
   digitalWrite(n -1, HIGH);
}

…R

Thanks so much Robin2 , But if you can help me with this code and try to edit it by yourself for the pedestrian button and millis(),it would be an honour

kflosh: Thanks so much Robin2 , But if you can help me with this code and try to edit it by yourself for the pedestrian button and millis(),it would be an honour

How does this square with the thread title "Need _help _ with the code, please." ?

But if you can help me with this code and try to edit it by yourself

Ask yourself what exactly is the difference between helping you and doing it for you?

Helping you is telling you what you need to do, editing the code is doing it for you. We are very good at the former but not the latter on this forum. Especially for people who are disrespectful when they are told to do something and totally ignore it.

kflosh: Thanks so much Robin2 , But if you can help me with this code and try to edit it by yourself for the pedestrian button and millis(),it would be an honour

I have no plans to write code for you. That is your job.

If you want someone to write a program for you please ask in the Gigs and Collaborations section of the Forum and be prepared to pay.

...R