Rotating Servos in Counter Directions

Hi,

I am new to arduino and am looking for some guidance about some code. I have written the code to move to servos simultaneously when a joystick is pushed forward, however I want to make one servo go one way, while another servo goes the other way. Any help would be greatly appreciated. Thanks.

#include <Servo.h>

Servo servo1;//front leg servo
Servo servo2;//back leg servo
Servo servo3;//flipping mechanism servo
int servopos = 0;
int servoposrear = 59;
int joyY = A0;//joystick to move legs allocated to analog pin 0
int redLed(8);
int greenLed(9);
int ldrPin(A1);
int button1 = A2;// button for flipping mechanism allocated to analog pin 2

void setup() {
Serial.begin(9600);
servo1.attach(2);//servo1 is attatched to digital pin 2
servo2.attach(3);//servo2 is attatched to digital pin 3
servo3.attach(4);//servo3 is attatched to digital pin 4
pinMode (redLed, OUTPUT);
pinMode (greenLed, OUTPUT);
pinMode (ldrPin, INPUT);
pinMode (button1, INPUT);

}

void loop() {

//code for flipping mechanism
if(digitalRead(button1) == HIGH) // if button 1 is pushed down
{
servo3.write(0);

}else{
servo3.write(180);
delay(1000);
}

//code to run LDR and LED’s
int LDRvalue = analogRead(A1);//LDR value read from analog pin 0
float voltage = LDRvalue * (5.0 / 1023.0); //equation to find voltage

Serial.print("Voltage = ");//print the words “Voltage =”
Serial.print(voltage);//print value given of voltage from equation
Serial.println();//print a new line
delay(300);//wait 300 ms

if(voltage > 3){//if voltage gives a higher value then 4.6
digitalWrite(greenLed,HIGH);//turn green led on
digitalWrite(redLed, LOW);//turn red led off
}else{ //otherwise
digitalWrite(redLed,HIGH); //turn red led on
digitalWrite(greenLed, LOW);//green led off
}

//Code to run Joystick and corresponding servos
if (analogRead (joyY) == LOW) //if joystick is pushed upwards
{
for(servopos>=0; servopos<=59; servopos++)//so long as its greater than or equal to zero, smaller than or equal to 59, increase position by 1 up until 60
{
servo1.write(servopos);//turn servo1 to new position
servo2.write(servopos);//turn servo2 to new position
delay (10);
}
}
for(servopos<=59; servopos>=0; servopos–){ //so long as current position is smaller than or equal to 59, greater than or equal to 0, decrease servo by 1 until hits -1
servo1.write(servopos);//turn servo1 to new position
servo2.write(servopos);//turn servo2 to new position
delay (10);
}
}

In general if you have 2 servos and you want them to turn in opposite directions do this

byte pos = 50;
servo1.write(pos);
servo2.write(180 - pos);

You can't connect an LED to the smiley face pin.