Capstone Project help

Hello, im new to Arduino and havent recieved it yet, i wrote some code and was curious to know if it would work. The code is supposed to be for a light following device, it will have 4 ldr that are attached to the top of a servo thats connected to another servo, this is the coding i have wrote , could someone tell me if it will do what i think it will do, thank you

#include <Servo.h> // do i need this twice, for two servos?

Servo servo_1;
Servo servo_2;
int servo_1_position = 90; // servo is from 0 to 180
int servo_2_position = 90;

int ldr_up = 0;
int ldr_down = 0;
int ldr_left = 0;
int ldr_right = 0;

void setup()
{
servo_1.attach(9); //servo input at pin 9
servo_2.attach(10);
Serial.begin(9600);
}

void loop()
{
ldr_up=analogRead(ldr_up); //gets analog readings from ldr
Serial.println(ldr_up); //print to screen values (i think)

ldr_down = analogRead(ldr_down);
Serial.println(ldr_down);

ldr_right = analogRead(ldr_right);
Serial.println(ldr_right);

ldr_left = analogRead(ldr_left);
Serial.println(ldr_left);

int vertical = ldr_up - ldr_down;
int horizontal = ldr_right - ldr_left;

/////// Vertical //////// (Servo 2) //////
if (vertical <= 50)
{
servo_1_position = --servo_1_position;
}

else if (vertical >= -50)
{
servo_1_position = ++servo_1_position;
}

else if (vertical == 0)
{
// do nothing
}

/////// Horizontal ////// (Servo 2) //////
if (horizontal <= 50)
{
servo_2_position = --servo_2_position; // not sure about the direction
}

else if ( horizontal >= -50)
{
servo_2_position = ++servo_2_position;
}

else if ( horizontal == 0);
{
//do nothing
}

delay(1000);

}

sdfa:
could someone tell me if it will do what i think it will do, thank you

Why don't you try building and running it, and find out for yourself?

LOL

The best way to know if code works is to run it.

#include <Servo.h> // do i need this twice, for two servos?

No

ldr_up=analogRead(ldr_up);  //gets analog readings from ldr

You're storing an analog value (0-1023) into the same variable which you are defining your pin.

try instead one of the following,

ld_up = analogRead(A0);
ld_up=analogRead(0);
ld_up=analogRead(analogPin);

Serial.println(ldr_up);  //print to screen values (i think)

you are correct, the value inside ldr_up will be displayed (the value likely wont be what you want due to what i said above).

I dont see any other obvious errors without running/compiling the code

i would but i dont have any of the pieces, i get the pieces when i start school