#include //library Servo myservo; // servo objects Servo myservo2; int potpin = A0; // analog pin used to connect the potentiometer int val = 0; // variable to read the value from the analog pin void setup() { myservo.attach(6); // attaches the servo myservo2.attach(7); } void loop() { val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 180); // reduce it for use with the servo (value between 0 and 180) myservo.write(val); myservo2.write(val); // sets the servo position according to the scaled value delay(15); // waits for the servo to get there }