Servo myservo; // create servo object to control a servo Servo myservo2; Servo myservo3; int potpin = 0; // analog pin used to connect the potentiometer int potpin2 = 1; int potpin3 = 2; int val; // variable to read the value from the analog pin int val2; int val3; void setup() { myservo.attach(3); // attaches the servo on pin 9 to the servo object myservo2.attach(5); myservo3.attach(6); } void loop() { val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180) myservo.write(val); // sets the servo position according to the scaled value val2 = analogRead(potpin2); // reads the value of the potentiometer (value between 0 and 1023) val2 = map(val2, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180) myservo2.write(val2); // sets the servo position according to the scaled value val3 = analogRead(potpin3); // reads the value of the potentiometer (value between 0 and 1023) val3 = map(val3, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180) myservo3.write(val3); // sets the servo position according to the scaled value }