speed control of two servos

I am trying to control the speed of two servos operating at the same time. Right now they operate at max speed, one counter clockwise, the other clockwise. Code so far is a follows.

const int sensorPin = A0;
int lightLevel = 0;
#include <Servo.h> // servo library
Servo servoFLCW, servoFLCCW; // servo control object

void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
servoFLCW.attach(2);
servoFLCCW.attach(3);
}

void loop(){

lightLevel = analogRead(sensorPin);
Serial.print("Light level Bay 1: ");
Serial.println(lightLevel);

if ((lightLevel) > 2);

{
delay(2000);
doorFLCW();
}
}

void doorFLCW() {

if ((lightLevel) < 300) {

servoFLCW.write(135);
servoFLCCW.write(5);
}

else

{

servoFLCW.write(5);
servoFLCCW.write(135);
}

Any constructive help would be appreciated.

servo speed library

thanks I will try

Look at how the servo is controlled in the demo several things at a time. It would be very simple to add another servo.

...R

It does what I need it to . It is operating the two doors for a roundhouse bay. Took the true statement at the end out so that they operate at the same time.

if ((lightLevel) > 2);

Did you fix that one?