Hi !
I give you here the schematics of a project I already soldered, but doesn't work... The idea is to build a controller (communicating with puredata), sending pots, pushbuttons and rotative coders values and receiving commands to know which leds have to be turned on.
This project uses mainly the 4067B 16-channel multiplexer. In fact, multiple in parallel.
I must give some precisions about this schematics :
-- each multiplexers uses 10 channels, but to keep it clear, only 2 are actually drawn. So in fact, there are 10 potentiometers, 10 rotary encoders, 20 push buttons and 20 LEDs.
-- i don't have enough digital I/O (need two additional digital pins for the 2 LED groups), because i decided to separate the readings of the pots coders and buttons from the LEDs. This because i wanted to keep the "LEDs switching" fast enough to have the optical illusion they're always on.
-- push-buttons and rotative coders are read with the following method (avoiding the use of resistors) :
pinMode(X, INPUT);
digitalWrite(X, HIGH);
I never finished the code because even on a small part of the project, it doesn't work. I give as an example the test for the LEDs (make all of them blink) :
int i;
int b = 0;
boolean st;
void setup() {
for (i = 8; i < 14; i++) {
pinMode(i, OUTPUT);
}
st = true;
}
void loop() {
for (i = 0; i < 10; i++) {
PORTB = i << 2; // 4-bit address coding on pin 10-13
digitalWrite(8, st); // set the LED pin HIGH or LOW
digitalWrite(9, st);
delayMicroseconds(100); // wait
}
b++;
if (b > 500) { // toggle LED pin value
b = 0;
st = ~st;
}
}
The result is that all LEDs of the first multiplexer blink, but for the second, only one glows.
If I re-build the circuit on a breadboard with only the two groups of LED an 2 multiplexers, it works fine, while the same doesn't with all the rest of the circuit. I must say that I verified ten times every connection with a multimeter.
The only strange thing I found is that the current between VDD and VSS was about 3,6V instead of 5V. I'm not very good with the electric laws so I'm suspecting that I need some resistors, somewhere..... but I saw some similar examples of "in parallel multiplexers" technique (like "fluidform" tutorial from Playground).
Please help me ! I'm hopeless, since this is the controller of my dreams...
PS : i'm french, please forgive my approximate english
Thanks by advance