Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Troubleshooting / Re: problem reading a specific analog output on: January 15, 2006, 05:17:00 pm
Thanks for the quick answer and it works a bit better now.

Another problem I have is that when I change one of potentiometers that I haven't configured it to read the output to the computer just stops with a strange and always different letters.

Also, if I set one of the potetiometers to a specific position and then set to other to a different one, I get two different values which is good. But they aren't very stable and can change without me even touching the potentiometer.
2  Forum 2005-2010 (read only) / Troubleshooting / problem reading a specific analog output on: January 13, 2006, 12:48:51 pm
Hi!

I wrote this little app to read from specific inputs on a multiplexor and I have 8 small potentiometers.

The problem is that when I ativate one input and read it's value it still reads all the other 7 values so it doesn't matter which input I activate I can still change the value with any of the potentiometers.

I'm using a: 74HCT4051N multiplexer
and regular analog potentiometers.

My code:
Code:
int analog1 = 0;
int value = 0;

void setup() {
 beginSerial(9600);        // connect to the serial port
}

void changeMpu(char val1, char val2, char val3) {
 digitalWrite(1, val1);
 digitalWrite(2, val2);
 digitalWrite(3, val3);
}

void loop() {
 changeMpu(LOW, LOW, LOW);  
 delay(1000);
 printString("A");
 value = analogRead(analog1);
 printInteger(value);
 serialWrite(10); // <-- end of line
 serialWrite(13); // <-- carriage return
 
 changeMpu(HIGH, LOW, LOW);
 delay(1000);
 printString("B");
 value = analogRead(analog1);
 printInteger(value);
 serialWrite(10); // <-- end of line
 serialWrite(13); // <-- carriage return
}


Thanks in advance!
/sebb0
Pages: [1]