#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
myservo.attach(3); // attaches the servo on pin 9 to the servo object
}
void loop() {
for(int i=180;i>0;i--){
myservo.write(i);
delay(100);}
for(int i=0;i<180;i++){
myservo.write(i);
delay(100);}
}