#include <Servo.h>

Servo sA;
Servo sB;

void setup() 
{
 sA.attach(11);
 sB.attach(10);
 sA.write(180);
 sB.write(90);
}

void loop() 
{
  rotate();
}

void open()
{
  sA.write(0);
  sB.write(90);
}

void close()
{
 sA.write(90);
 sB.write(0);
}

void rotate()
{
  uint8_t i,j;
  for(i=0;i<180;i++)
  {
    sA.write(i);
    delay(10);
  }
  for(j=0;j<180;j++)
  {
    sB.write(j);
    delay(10);
  }
  for(j=180;j>0;j--)
  {
    sA.write(j);
    delay(10);
  }
  for(i=180;i>0;i--)
  {
    sA.write(i);
    delay(10);
  }
}