#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup()
{
Serial.begin(9600);
// attaches the servo on pin 10 to the servo object
myservo.attach(10);
}
void loop()
{
Serial.println("0");//Baruun ergeh hurdan
myservo.write(0);
delay(3000);
myservo.detach();//zogsooh
delay(2000);
myservo.attach(10);
Serial.println("0");//Baruun ergeh hurdan
myservo.write(180);
delay(3000);
myservo.detach();//zogsooh
delay(2000);
myservo.attach(10);
}