Hi. I am very excited to have found this forum. In a short time, I have learned quite a bit.
My request today is rather unique. For my daughter's school science project, we need to sequence 13 LEDs.
There are three imperatives:
The sequence must be random, any one of the 13 LEDs can start the sequence (or several at once)...the ticket here is the more randomization, the better.
The sequence must start from all LEDs off, illuminate each LED in once scond steps, holding each LED lit, until the sequence finally allows all of the LEDs to have illuminated.
After the sequence is complete (all of the LEDs have illuminated), all LEDs have to blink one time and then go out, which allows a new random sequence to begin
If anybody can give us some programming direction on this, you are going to make an 11 year old VERY HAPPY!!!!!
Take a look at random function on the References page.
Use to fill an array withthe sequence you want.
Then to light the LEDs from the array is simple, as is turning them all off and on and off for the blink before restarting.
Using a ws2811 based led-strip is an option that could very well be used, but it also seems overkill to me.
With twenty I/O-pins available on the arduino you can just as well connect a led + current limiting resistor to thirteen of its pins. Two of those twenty pins are used to communicate with the PC which still leaves room to add five buttons If you'd like. Most standard leds are capable of handling 20 mA each, but since the arduino can handle 200mA max it probably is wise to limit each led to 10mA though.