potentiometer problems

Potentiometer problems ok this is the deal I have two pot's one on A0 and one on A1.
All good but if I turn pot A0 it changes A1 same for A1 turn it pot A0 changes.

Well, I guess we should see your sketch and a good picture of your actual wiring.

There is one analog-to-digital converter in the ATmega chip, multiplexed between the analog inputs. It may need a short time to "settle" and stabilize. Try taking each reading twice, ignoring the 1st reading, or add a short delay between readings.

I assume you have a capacitor on each analog pin, .1uf would be good.
What value is the pot(s).
Yes, the suggestion to delay a bit (1ms), take two readings, delay, and discard the first one is a good suggestion from DVDdoug.

Heres the code it's th knob code

/* 
 Controlling a servo position using a potentiometer (variable resistor) 
 by Michal Rinott <http://people.interaction-ivrea.it/m.rinott> 

 modified on 8 Nov 2013
 by Scott Fitzgerald
 http://www.arduino.cc/en/Tutorial/Knob
*/

#include <Servo.h>

Servo myservo1;  // create servo object to control a servo 
Servo myservo2;

int potpin1 = 0;  // analog pin used to connect the potentiometer
int potpin2 = 0;
int val1;    // variable to read the value from the analog pin
int val2;

void setup()
{
  myservo1.attach(6);  // attaches the servo on pin 9 to the servo object
  myservo2.attach(5);
}

void loop() 
{ 
  val1 = analogRead(potpin1);            // reads the value of the potentiometer (value between 0 and 1023) 
  val1 = map(val1, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180) 
  myservo1.write(val1);                  // sets the servo position according to the scaled value 
  delay(15);                           // waits for the servo to get there 
   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 
  delay(15);                           // waits for the servo to get there 
}

There 10 pots there reading as 5k each

potpin1 and potpin2 are both = 0
did you want A0 and A1 ?

Here the sch.

pots.png

LarryD:
potpin1 and potpin2 are both = 0
did you want A0 and A1 ?

I see that set's the pins both to 0 LOL I was thinking it was just a variable and it is just pointing to the wrong one LOL.

"There 10 pots there reading as 5k each"

I don't understand the 10 pots. I thought it was two.

I don't see any problems other than what LarryD points out.

It is two 10 k pots but they read as there in parallel so there reading as 5 k but the change the reading on one it you move one.
Say one is at 3.3 k that changes it to 2.4 k

Get in the habit of doing:

const byte potpin1 = A0;
const byte potpin2 = A1;

Can you read the center tap of the two post with a volt meter? How does it look as you turn the pot?
The pots being connected between ground and 5v, you should see the center tap voltage swing between ground and 5v (with about 2.5v half way). Does that look right?

Have we got the problem solved yet? I don't want to keep asking questions if you have it already fixed.. lol.

It was the potpin2 = 0 I was thinking wrong it's a pointer to the pin your setting I though it was just a int and needed a starting val of 0 It works.

Think that works https://youtu.be/9Dgu38bXOCc

I think you had better release that thing back into the woods. :wink:

.

Oh, time to make yourself a real work bench.

.

LarryD:
I think you had better release that thing back into the woods. :wink:

.

Hey it took a day to catch it it :smiley: :wink:
I got one just drag the stuff out in the living room to watch tv. End table to small.

LOL. Yesterday, I went out to close the gate, and the two dogs went with me. We heard a loud grunt (from a wild hog). The old dog ran out the gate and chased the hog. The young dog, turned tail and ran back to the house. I just stood there, watching. lol

Now to write better code it's little jumpy. But if I added more pot's wouldn't they need to be like 20 k.

If I had my druthers, I would prefer about 40k pots. 10k is a bit low for the arduino analog inputs. Well, actually it draws more power than a 40k pot would.