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