Designing a progect and need to know where to put diodes properly

Hi folks im new to arduino having tonnes of fun and picking my brothers brain all the time that is studying programming.

here is my problem i am trying to design a step sequencer and came up with a solution that can add more analog ins if it works properly.

i am running multiple pots to the same analog input and instead of connecting to the +5 v i am feeding them with digital outs. say step ones pot is fed power by digital out grounded and the conected to analog in 1
then step 2 is fed with power from digital out 2 grounded and sent to analog in 1 as well

here is the code

// multiple pots reaD to a single a single analog in
// dec 16 2014
// to figure out how to make multiple pots read to a single anolog in
// Shane Fortier

const int pitch = 1;
const int step1 = 5;
const int step2 = 6;
const int speaker = 9;

void setup()
{
pinMode (step1,OUTPUT);
pinMode (step2,OUTPUT);
pinMode (speaker, OUTPUT);

}

void loop ()
{
digitalWrite(step1, HIGH);
tone(speaker,analogRead(pitch));
delay (500);
digitalWrite (step1, LOW);
delay(2);
digitalWrite(step2, HIGH);
tone (speaker, analogRead(pitch));
delay (500);
digitalWrite (step2, LOW);
delay (2);
}

now the problem i am having is the setting of step 1 is affected by the resistance of step 2
how to i overcome this?

i have tried putting LED's between each of the digital outs and the pots as well as between the pots and the grounds and the signal and the feed to analog in 1 Any advice would be very welcome and thanked

I think I'm confused.... Are you trying to select the "active" pot by switching the digital output?

That's not going to work without more circuitry....

Or, I assume you know the Arduino has more than one analog input...

// multiple pots reaD to a single a single analog in

That's called "multiplexing". Take a look at [u]this example[/u].

In fact, the Arduino chip has only one analog-to-digital converter and it uses internal multiplexing to get multiple analog inputs.

This trick may works, if you use 2 digital pin per each pot. Connect one side of the pot to one digital pin , configured as output and set as HIGH, another side of pot to second digital pin, output set as LOW. Wiper of the pot connected together with another wiper of second pot and to analog input. The idea to select a pot one at a time, by switching two digital pins to Input , make pot disconnected from both end, basically "isolated" - so its not interfere to second one