I am testing a 74HC4067E MUX setup with my Arduino Uno which I would like to use to selectively light up many LEDs, one at a time. For this first test, I am using a modified version of the blink tutorial. Essentially, I am setting the 4 control pins to digital LOW and setting the input to HIGH, through a resistor appropriate for my LED. I am also providing 5V to the Vcc pin on the MUX. I don't really know why I am doing this, but it seems to work. Here is my code:
int led_input = 0;
int led_ctrl_1 = 1;
int led_ctrl_2 = 2;
int led_ctrl_3 = 3;
int led_ctrl_4 = 4;
void setup() {
pinMode(led_input, OUTPUT);
pinMode(led_ctrl_1, OUTPUT);
pinMode(led_ctrl_2, OUTPUT);
pinMode(led_ctrl_3, OUTPUT);
pinMode(led_ctrl_4, OUTPUT);
}
void loop() {
// control signal
digitalWrite(led_ctrl_1, LOW);
digitalWrite(led_ctrl_2, LOW);
digitalWrite(led_ctrl_3, LOW);
digitalWrite(led_ctrl_4, LOW);
// input signal
digitalWrite(led_input, HIGH);
delay(500);
digitalWrite(led_input, LOW);
delay(500);
}
I know, the code could be more efficient.
The blue LED is hooked up to I0 and blinks as it should. The problem comes when I try to change the control pin values. When I change it to, say 6...
// control signal
digitalWrite(led_ctrl_1, LOW);
digitalWrite(led_ctrl_2, HIGH);
digitalWrite(led_ctrl_3, HIGH);
digitalWrite(led_ctrl_4, LOW);
... and I move my LED to I6, I get no blink. I've tested all the pins and it doesn't seem like there is a signal coming from any of them. I assume that I am using the chip wrong, but I'm not sure how. Pictures of my setup follow... any help is greatly appreciated!
- Arduino pin 0 maps to chip pin 1 (through resistor) as input.
- Arduino pins 1-4 map to chip pins 10, 11, 14, and 13 in that order.
- I have a 5V going to chip pin 24.
- The LED is connected long leg to chip pin 9 in the images, the grounded.
E
toF
on the breadboard for these pins, they are thus not connected to your IC.