Servo control

I’m having trouble controlling multiple servos individually with multiple potentiometers. How would I create a program for that? Everything that I have tried has not worked. If anyone can help, I would appreciate it.

Go here. This shows you how to do it for one servo. Simply wash, rinse , repeat for additional servos

Or you could post the code that you have tried and tell us what it does or doesn't do.

#include <Servo.h>
Servo Servoa;
int potpin1 = 0;
int val1;

Servo Servob;
int potpin2 = 1;
int val2;

Servo Servoc;
int potpin3 = 2;
int val3;

Servo Servod;
int potpin4 = 3;
int val4;

void setup()
{
Servoa.attach(11);
Servob.attach(10);
Servoc.attach(9);
Servod.attach(6);
}

void loop()
{
val1 = analogRead(potpin1);
val1 = map(val1,0,1023,0,179);
Servoa.write(val1);
delay(8);

val2 = analogRead(potpin2);
val2 = map(val2,0,1023,0,179);
Servob.write(val2);
delay(8);

val3 = analogRead(potpin3);
val3 = map(val3,0,1023,0,179);
Servoc.write(val3);
delay(8);

val4 = analogRead(potpin4);
val4 = map(val4,0,1023,0,179);
Servod.write(val4);
delay(8);

}

All that it will do is vibrate rapidly but it will not respond to the potentiometers.

All that it will do is vibrate rapidly but it will not respond to the potentiometers.

Probably inappropriate power supply or bad grounding. Don't try to power servos from the arduino.

How should I power the servos?

How should I power the servos?

Like below.

servo power.jpg