servo delay

not that I really need this sketch to work other then trying to learn the code but the way that I have wrote it my servo waits till my leds have finished theyre loop how do I add a second loop

#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
 
int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin 
int redPin = 12;                  // Red LED connected to digital pin 12
int greenPin = 11; 
int yellowPin = 10;// Green LED connected to digital pin 11

 
void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
  pinMode(redPin, OUTPUT);        // sets the digital pin as output
  pinMode(greenPin, OUTPUT);  
  pinMode(yellowPin, OUTPUT); // sets the digital pin as output
} 
 
void loop() 
{ 

  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023) 
  val = map(val, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180) 
  myservo.write(val);       // sets the servo position according to the scaled value 
  delay(15);         // waits for the servo to get there
  digitalWrite(redPin, HIGH);     // sets the Red LED on
  digitalWrite(greenPin, LOW);  // sets the Green LED on
  digitalWrite(yellowPin, LOW);
  delay(350);                     // waits for half a second
  digitalWrite(redPin, LOW);      // sets the Red LED off
  digitalWrite(greenPin, HIGH);    // sets the Green LED off
  digitalWrite(yellowPin, LOW);
  delay(350);                     // waits for half a second
  digitalWrite(redPin, LOW);      // sets the Red LED off
  digitalWrite(greenPin, LOW);    // sets the Green LED off
  digitalWrite(yellowPin, HIGH);
  delay(350);
  digitalWrite(redPin, LOW);      // sets the Red LED off
  digitalWrite(greenPin, HIGH);    // sets the Green LED off
  digitalWrite(yellowPin, HIGH);
  delay(350);
  digitalWrite(redPin, HIGH);      // sets the Red LED off
  digitalWrite(greenPin, HIGH);    // sets the Green LED off
  digitalWrite(yellowPin, LOW);
  delay(350);
}

From your post, it's a little hard to guess what you want to do. If you just want to move the servo after you turn on the some light, move the myservo.write() statement to the right place in the code.

If you want to move the servo a bit after each led change, you must add a few myservo.write() after or before the delay() calls.

If you want to have the servo do something independent of the light show, you need to look at the Blink without delay tutorial. It will teach you how you can do other things while having some things wait.

If you want something different, you must be clearer what it is.

Korman

being a total newb makes it hard to say what I want and it was late last night when I wrote that I want the leds to blink with delays and I want the servo to turn seemlessly without the delays from the leds if that makes sense probably what your second option is I will look at the link now thanks