I am going to be building an array of 8 IR range sensors which output a variable voltage level based upon how an object is away from it.
Instead of using all 8 A2D ports on the mega128, I want to use a multiplexer and make a scanned type interface where I'll have the mega128 set the selection bits on a MUX and poll the 8 devices one at a time.
The problem I am having is that all of the MUX's I have seen online that I have searched for will only output 5v or 0v depending on whatever the input that's selected is.
I need the output to be variable from 0v to 5v so it can be hooked into the A2D.
The problem with the mux is that each of the 8 inputs go directly into an AND gate (which also has the three selection lines going into them). I think what I want instead is for the output of those AND gates to be hooked into a tri-state gate (and the input to the tri-state gate would be one of the 8 outputs from the IR sensors) and for each of the tri-state gates to be controlled by each of the outputs from the AND gates. Then all of those would be tied together and only one of them would be active at a time.
Does anyone know of an IC that already does this, I haven't been able to find one.