/*Rectify the cicuit has it has wrong connection but the given code is correct*/
#include <Servo.h>
int pos = 1;
Servo myservo;
void setup() {
// put your setup code here, to run once:
myservo.attach(9);
}
void loop() {
// put your main code here, to run repeatedly:
for (int i = 0; i <= 360; i++) {
delay(10);
pos=pos+1;
myservo.write(pos);
}
}