Go Down

Topic: [SOLVED]: Analog values through multiplexer are very inconsistent! (Read 2 times) previous topic - next topic

RIDDICK

#10
Jun 17, 2012, 05:51 pm Last Edit: Jun 17, 2012, 05:53 pm by RIDDICK Reason: 1
still not pinMode() call?

i mean code like this in setup():
Code: [Select]
pinMode(s0,OUTPUT);
pinMode(s1,OUTPUT);
pinMode(s2,OUTPUT);
pinMode(s3,OUTPUT);

so that the mux-config-arduino-pins r low-impedance pins...
-Arne

Grumpy_Mike

What value of capacitor? Make it smaller.
Code: [Select]
int xAnaRead = analogRead(xPin);
 delay(100); //to let the capacitator discharge

 //read value on channel 1 of Mux
 yMuxRead = readMux(1);  



This delay is doing nothing because it is while the input is switched through you need to do this:-
Code: [Select]
int xAnaRead = analogRead(xPin);
 delay(100); //to let the capacitator discharge
 xAnaRead = analogRead(xPin); // now read the value once it has discharged
 //read value on channel 1 of Mux
 yMuxRead = readMux(1);
 delay(100); //to let the capacitator discharge
   yMuxRead = readMux(1);

dieselboris


still not pinMode() call?

i mean code like this in setup():
Code: [Select]
pinMode(s0,OUTPUT);
pinMode(s1,OUTPUT);
pinMode(s2,OUTPUT);
pinMode(s3,OUTPUT);

so that the mux-config-arduino-pins r low-impedance pins...


hmm according to the tutorial in bildr its not neccessary, nut i'll give it try!

Grumpy_Mike

Quote
hmm according to the tutorial in bildr its not neccessary,

No you misread that.

RIDDICK

Quote
nut i'll give it try!

yup - give it a try...  *wag tail* ;)
-Arne

Go Up