For the election results tomorrow I had the idea just now to light up an American flag with sparkling LEDs on the stars and maybe some waving effect LEDs on the stripes.
Since I would have to get this done in a few hours tomorrow (11/9) I am interested to know if anyone could provide some advice for the quickest and most reliable way to do this.
I have 2 unos and 3 nanos. What I really want to do is make the stars twinkle. I don't have immediate access to addressable LEDs so I thought to use shift registers and connect each output to an LED. So it looks like 50 stars / 8 channels / register = 6.25 or 7 shift registers. I just want to use digitalWrite to randomly light up each led for a split second with a random delay so they're all twinkling randomly.
I haven't used shift registers before, can I pull this off by tomorrow evening? If so, can anyone provide any good example information / libraries or experience for how I can program the sketch and set up hardware for this? It looks like one shift register NTE74HC165 can support 25mA output so I can directly tie to LEDs. I can get 5V supply from a USB charger.
I would greatly appreciate any suggestions!
Single MAX7219 is all you need, control up to 64 LEDs. Easy to control the individual LEDs.
Thanks. I need to get the chip tomorrow, do you happen to know where I can get it? I live in the Detroit area. There is Microcenter, RadioShack, and a few smaller mom & pop stores, I didn't see the MAX7219 on their online stores. Is there any chip I can probably buy tomorrow locally here that will do the job?
If you can't get MAX719, then daisy chain enough shift registers (& current limit resistors*) to drive 50 LEDs, and shift out the on/off data needed.
- (5V - Vf)/.02A = resistor needed
Twinkling LEDs says white LEDs to me, Vf usually ~ 3.5V, so (5V - 3.5)/.02 = 75 ohm or higher resistors
Thanks, Actually at Microcenter I see they carry some LED matrix displays including a FeatherWing LED matrix driver (They carry Adafruit) http://www.microcenter.com/product/465193/8x16_LED_Matrix_FeatherWing_without_Matrices that is a 8x16 matrix maybe I can tie into the LED connection points.
In the end I got it done with 2 nanos. There are 6 rows of 5 LEDs and 5 rows of 4 LEDs so I divided them that way, one nano for each grid. I used 1 IO pin for each row and 1 for each column. Total would have been 20, one more than supported by the uC. There were shift registers at Microcenter but I avoided the time and cost to get them. Thus the 2 nanos. The LEDs are cut individually from a 5V strip reel (includes individual resistors) with adhesive backing. It works really well. I am just turning on one LED at a time, but randomly over the entire grid pretty rapidly so it appears they are all twinkling. I will post a quick vid I think it's a nice effect at night. Thanks for your ideas.