#include <Servo.h>
Servo servo ;
int eastLDR = 0;
int westLDR = 1;
int east = 0;
int west = 0;
int error = 0;
int calibration = 10;
int servoposition = 90;
void setup()
{
  Serial.begin(9600);
  Serial.println("The project output:");
  servo.attach(9);
}
void loop()
{
  
east = calibration + analogRead(eastLDR);
west = analogRead(westLDR);
Serial.print("The values of east sensor: ");
Serial.println(east);
Serial.print("The values of west sensor: ");
Serial.println(west);
if (east < 350 && west < 350)
{
  Serial.println("The values of east and west are less than 350, go to east by default.");
while (servoposition <= 150){
servoposition++;
servo.write(servoposition);
 delay(100);
}
}
error = east - west;
if (error > 15)
{
if (servoposition <= 150)
{
servoposition++;
servo.write(servoposition);
}}
else if (error < -15)
{
if (servoposition > 20)
{
servoposition--;
servo.write(servoposition); 
}}
delay(100);
}