Need Help to complete this code

Hi Coders,

I am totally new to arduino and to this forum, I am from class 8 looking for a project for my expo. I had this idea of automatic barrier integrated to traffic lights.

This is the idea poped on my head and i am looking for experts help to complete my code.

  1. automatic traffic light system , where the R Y G LEDs goes on and off on the timing fixed

  2. Now i wanted to upgrade with barrier system

  3. when green is high i want the servo to rotate from say 0' to 120'(technically to be a stop gate) - R and Y low

  4. when yellow is high the servo has to move slowly from 120' to 0' - R and G low

  5. once it reaches to 0' the RED LED has to be high, rest all LED should be low

Please help me at the earliest.I have written the simple code traffic light but need support to complete as per my idea.

void setup() {

pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);

}

void loop()
{
{
digitalWrite(8, HIGH); // Turns LED on pin 13 on
delay(2500); // LED on pin 13 remains on for 5 seconds
digitalWrite(8, LOW); // Turns LED on pin 13 off
delay(0);}
digitalWrite(9, HIGH); // Turns LED on pin 12 on
delay(2500); // LED on pin 12 remains on for 5 seconds
digitalWrite(9, LOW); // Turns LED on pin 12 off
delay(0);
digitalWrite(10, HIGH); // Turns LED on pin 11 on
delay(2500); // LED on pin 11 remains on for 5 seconds
digitalWrite(10, LOW); // Turns LED on pin 11 off
delay(0);
}

Cross posted. It seems the OP is trying in yet another forum in the hope that someone here will write his code for him. See TRAFFIC LIGHT WITH BARRIER - Programming Questions - Arduino Forum

Steve

Jeffnavin:
Please help me at the earliest.I have written the simple code traffic light but need support to complete as per my idea.

You have not told us what the simple code actually does, or what changes to its behaviour are required.

Study these links - they probably illustrate most of the techniques you require.
Planning and Implementing a Program
Several Things at a Time

...R