#include <Servo.h> // include the servo library
const int ServoPin = 11;
Servo myServo; //initialize the servo object
// we will control our servo with
void setup() {
// put your setup code here, to run once:
// we will attach our servo pin with the myServo object
myServo.attach(ServoPin);
}
void loop() {
// put your main code here, to run repeatedly:
// Servos usually have a max of 180 degrees
for ( int i = 0; i < 180; i++ ) {
myServo.write(i); // writes the specific angle the servo will be on
delay(20); // delays are in miliseconds
}
}