#include <Servo.h> //Servo library

Servo camera_servo_1; //initialize a servo object for the connected servo
Servo camera_servo_2;
Servo camera_servo_3;
int angle_1, angle_2, angle_3 = 0;

int potentio_1 = A0;
int potentio_2 = A1;
int potentio_3 = A2; // initialize the A0analog pin for potentiometer

void setup() {

camera_servo_1.attach(9);
camera_servo_2.attach(10);
camera_servo_3.attach(11);  // attach the signal pin of servo to pin 9 of arduino

}

void loop() {

angle_1 = analogRead(potentio_1);
angle_2 = analogRead(potentio_2);
angle_3 = analogRead(potentio_3); // reading the potentiometer value between 0 and 1023

angle_1 = map(angle_1, 0, 1023, 0, 179);
angle_2 = map(angle_2, 0, 1023, 0, 179);
angle_3 = map(angle_3, 0, 1023, 0, 179); // scaling the potentiometer value to angle value for servo between 0 and 180)

camera_servo_1.write(angle_1);
camera_servo_2.write(angle_2);
camera_servo_3.write(angle_3); //command to rotate the servo to the specified angle delay(5);
delay(15);
}
A4988
A4988