   
 }
 
-int horiMinAngle = 0, horiMaxAngle = 100;
-int vertMinAngle = 0, vertMaxAngle = 100;
 
-int stepX = 17;
-int stepY = 7;
-
-int DELAY = 15;
-
-void moveX(int x){
-  if(x == 1 && curServoX == 150)
-    return;
-
-  if(x == -1 && curServoX == 30)
-    return;
-  int cnt = stepX;
-  while(cnt > 0){
-
-    curServoX += x;
-    curServoX = min( 150, max(30, curServoX));
-
-    servoHorizontal.write(curServoX);
-
-    cnt--;
-    delay(DELAY);
-
-    SoftwareServo::refresh();
-  } 
-}
-
-void moveY(int y){
-
-  if(y == 1 && curServoY == 90)
-    return;
-
-  if(y == -1 && curServoY == 10)
-    return;
-
-  int cnt = stepY;
-  while(cnt > 0){
-
-    curServoY += y;
-    curServoY = min( 90, max(10, curServoY));
-
-    servoVertical.write(curServoY);
-
-    cnt--;
-    delay(DELAY);
-    SoftwareServo::refresh();
-  } 
-}
 
 void moveXY(int x, int y){
-
-
-
   int cntX = stepX;
   int cntY = stepY;
   

int x, prevX;
int y, prevY;

int curServoX = 110, curServoY = 45;
void setup() { 
  Serial.begin(9600);

    if(servoX <= 25){
      xx = 1;
    }
    else if(servoX >= 45){
      xx = -1;
    }

    if(servoY <= 25){
      yy = 1; 
    }
    else if(servoY >= 45){
      yy = -1; 
    }
    
    SoftwareServo::refresh();
    moveXY(xx, yy);
    SoftwareServo::refresh();
  }
}

