G+_Chris O'Riley Posted December 11, 2017 Share Posted December 11, 2017 'Tis the season to Arduino, fra-la-la-la-la... la-la-la-la.... I had been itching to do an Arduino project, and we just picked up a Christmas tree, so I made a small wreath from the bottom few branches we had to cut off and thought I'd make a string of WS2812 LEDs to light it up. I had never programmed with arrays, so I decided to challenge myself. I wrote a sketch that populates a 3 x 10 array with random values and then fades from one color to another. When individual LEDs reach their To color, another set of RGB values is chosen for that LED and it begins fading to that color. Trivial stuff for some I'm sure, but not being much of a programmer, it was a good exercise for me. The whole thing was small enough to fit on an ATtiny 85 with room to spare. It only uses 33% of dynamic memory on the 85, so I could probably triple the number of LEDs... if I was so inclined to solder together that many... which I'm not! It draws about 130 milliamps, so I could probably get several hours from a AA with a voltage booster, but for now, it's just running from a USB phone charger. I'll take a video of it in action, but here's a photo of the string and the sketch, if anyone might be interested. http://www.chris3d.com/files/holiday_lights.zip Link to comment Share on other sites More sharing options...
G+_Chris O'Riley Posted December 11, 2017 Author Share Posted December 11, 2017 Here's a video of the wreath: Link to comment Share on other sites More sharing options...
G+_Chris O'Riley Posted December 11, 2017 Author Share Posted December 11, 2017 And as soon as I finished the wreath, my wife asked for a 3 LED string to light up some decorative houses. Going to have to order some more Tiny85's! Link to comment Share on other sites More sharing options...
Recommended Posts