Im new to this and have been reading about Multiplexing and Shift Registers to control multiple LED matrixes.
My question is: If I have two or more sets of LEDs, and I write a pattern for each one: then how do you run these patterns simultaneously?
In an LED matrix i understand that you would light up each LED very fast to get persistence of vision. Would I need to apply that technique to light up these patterns?
I would like to be able to have these patterns run at different speeds, for example one set of LEDs might be a chaser, another one might play a random pattern etc
This is what i want to do:
Any pointers in the hardware id need and programming techniques would be great. Im using a single Arduino Nano and have experience in programming.
The question still remains about how you go from this to adding additional LED patterns? You've used up all the pins.
Say you have 5 groups of LEDs on different boards, all running different patterns. If i wanted to run these patterns at the same time, would i have to use Shift Registers to light up the 1st steps of each pattern on each board, then the 2nd step, then the 3rd etc?
Seems a bit basic.
Is there not a chip that i can program for each board/group of LEDs, which i can then control from the main Arduino?
You could use some shift registers to get more output pins and run everything from one Arduino or you could use one Arduino for each set of lights. Which you choose depends a lot on your skill set.
I found some code from someone else that has programmed the Daft Punk helmet successfully.
// check to see if its time to animate the ear
if(currentTime > (lastEarFrame+earSpeed))
{
animateEar();
lastEarFrame = currentTime;
}
// check to see if its time to animate the cheek
if(currentTime > (lastCheekFrame+cheekSpeed))
{
animateCheek();
lastCheekFrame = currentTime;
}
// check to see if its time to animate the coloured bars
if(currentTime > (lastBarFrame+barSpeed))
{
animateBars();
lastBarFrame = currentTime;
}
// check to see if its time to animate the chin leds
if(currentTime > (lastChinFrame+chinSpeed))
{
animateChin();
lastChinFrame = currentTime;
}
From this example I can see that you can indeed run each animation from the same sketch by using the currentTime variable along with the time delays for each function.
I know this post is quite old but I was wondering if you might still be able to assist. I was able to adapt your code to my needs perfectly, however, is it possible to add code to control the Cheekpin LEDs with a push button, without interfering with the Chin LEDs?