This code turns the servo between 0 and 180 and then back // servo test 180 > 0 > 180 #include Servo myservo; // create servo object to control a servo int val; // variable to write to the servo void setup() { myservo.attach(11,600,2100); // attaches the servo on pin 11 to the servo object Serial.begin(115200); } void loop() { for (val=0; val < 179; val ++) { myservo.write(val); delay(10); } for (val=179; val > 0; val --) { myservo.write(val); delay(10); } }