#include <Servo.h>
// Create servo objects
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
Servo servo5;
// Declare analog pins for potentiometers
int potPin0 = A0;
//int potPin1 = A1;
//int potPin2 = A2;
//int potPin3 = A3;
//int potPin4 = A4;
// Declare variables to store potentiometer values
int potVal0;
//int potVal1;
//int potVal2;
//int potVal3;
//int potVal4;
void setup() {
// Attach servos to digital pins
servo1.attach(3);
servo2.attach(5);
servo3.attach(6);
servo4.attach(9);
servo5.attach(10);
}
void loop() {
// Read potentiometer values
potVal0 = analogRead(potPin0);
/*potVal1 = analogRead(potPin1);
potVal2 = analogRead(potPin2);
potVal3 = analogRead(potPin3);
potVal4 = analogRead(potPin4);*/
// Scale potentiometer values to servo range (0-180 degrees)
potVal0 = map(potVal0, 0, 1023, 0, 180);
/* potVal1 = map(potVal1, 0, 1023, 0, 180);
potVal2 = map(potVal2, 0, 1023, 0, 180);
potVal3 = map(potVal3, 0, 1023, 0, 180);
potVal4 = map(potVal4, 0, 1023, 0, 180);*/
// Set servo positions
servo1.write(potVal0);
servo2.write(potVal0);
servo3.write(potVal0);
servo4.write(potVal0);
servo5.write(potVal0);
// Wait for next loop iteration
delay(15);
}