Mulitple Pot/Servo Issues

Hello! I am using an arduino to control 3 servos with 3 potentiometers, and I have been using the circuit and code below for several weeks. But recently, no matter which potentiometer on the circuit I am using, only one servo (the one connected to pin 9) has been working. I am not sure why this happening, usually I can troubleshoot these kinds of things myself. Any advice would be greatly appreciated.

#include <Servo.h>

int potPin = 0;
int servoPin1 = 8;
Servo servo1;

int potPin2 = 1;
int servoPin2 = 9;
Servo servo2;

int potpin3 = 2;
int servoPin3 = 10;
Servo servo3;

void setup()
{
servo1.attach(servoPin1);
servo2.attach(servoPin2);
servo3.attach(servoPin3);
}

void loop()
{
int reading = analogRead(potPin);
int angle1 = reading /6;
servo1.write(angle1);

int reading2 = analogRead(potPin2);
int angle2 = reading2 / 6;
servo2.write(angle2);

int reading3 = analogRead(potpin3);
int angle3 = reading3 /6;
servo3.write(angle3);
}

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Have you swapped servos around to make sure the two not working are okay. Have you tried connecting only one servo up and testing each relevant output?

What are your servos, can you post a link to their specs. What value pots?

How are you powering the project? Can you post a picture of your project so we can see your layout please?

Thanks.. Tom.. :) PS. Do you have a DMM to measure circuit values?

What is the red thing in the image in the Original Post?

Post a link to its datasheet.

...R

Hi,

Robin2: What is the red thing in the image in the Original Post?

Post a link to its datasheet.

...R

Its a power supply pcb, dc socket through regulator select 3.3 or 5V, plugs into the power rails on the protoboard. I have a couple, helps heaps.. Tom.... :)

TomGeorge:
Hi,Its a power supply pcb, dc socket through regulator select 3.3 or 5V, plugs into the power rails on the protoboard.
I have a couple, helps heaps…
Tom… :slight_smile:

Is it capable of powering all those servos plus the Arduino?
…R