-
Hey! I want to connect 32 leds to arduino mega, i have no clue how could connect them. I dont have shift registers for them and i cannot buy them now, i only have 2 multiplexers CD74HC4067. Can i connect leds to arduino with multiplexers using your library? Also could i make a led matrix with this library. Could there be another solution? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
No, you can't use a multiplexer to drive LEDs. A CD74HC4067 just consists of 16 switches that connect between one common pin and 16 “channel” pins. Only one of the switches can be connected at any given instant. This means that if you try to drive LEDs using a multiplexer, you can only turn on one of them at a time, which is probably not what you want. A workaround is to scan through all outputs really quickly to create a persistence of vision, but this requires you to spend time updating the LEDs all the time, eating up precious CPU time on your microcontroller. The common solution is to use a special-purpose chip to do the scanning, so you don't have to worry about it in your microcontroller code. The same applies to matrices. You could do this on a microcontroller, but nobody actually does this because using the right driver chip in the first place is much easier. Control Surface doesn't support multiplexing LEDs or scanning LED matrices directly, but it does support LED drivers and MAX7219 LED matrix drivers. If you have an Arduino Mega, you should be able to drive all 32 LEDs from IO pins directly, just make sure you don't go past the ATmega2560 current limits. |
Beta Was this translation helpful? Give feedback.
No, you can't use a multiplexer to drive LEDs. A CD74HC4067 just consists of 16 switches that connect between one common pin and 16 “channel” pins. Only one of the switches can be connected at any given instant. This means that if you try to drive LEDs using a multiplexer, you can only turn on one of them at a time, which is probably not what you want. A workaround is to scan through all outputs really quickly to create a persistence of vision, but this requires you to spend time updating the LEDs all the time, eating up precious CPU time on your microcontroller. The common solution is to use a special-purpose chip to do the scanning, so you don't have to worry about it in your microcontr…