Circuit #4A: Servo Position

Ryan Ferguson

#include <Servo.h>


Servo myservo;  // create servo object to control a servo

// twelve servo objects can be created on most boards


int pos = 0;    // variable to store the servo position


void setup() {

  myservo.attach(11);  // attaches the servo on pin 9 to the servo object

}


void loop() {


    myservo.write(45);              // tell servo to go to position 45 Degrees


  }