//include this library for servos #include //next call a specific class by initialize servo, create a servo object Servo myServo; //function declaration void setup() { myServo.attach(9); //attach to pin 9, could connect an LED as well and it will do something. } //now a loop - will run forever as long as the arduino is powered. void loop() { // go to postion 0, can write a loop to have it keep moving to several positions. myServo.write(0); //call write method and go to home position, 0 delay(500); //go to home position and wait, because it takes time to get home myServo.write(180); //a second write, half turn from home - 180 (maximum commonly for standard servos) delay(500); }