Christmas LEDs
I suffer from this problem where any simple problem requires a complex solution, naturally chirstmas is coming up and the all departaments put up decoration, fat porcelain santas, blinking red and white lights, paper cutouts of the grinch and such. All departaments… but one… mine. Engineers tend to not care much for non strictly useful things, decoration is nice but doesn’t get anything done, I’m no different from my peers, but last christmas coffee breaks felt like a rift in time and portal was engineering’s door, from december to july, day to night, gifts to coal.
I took upon myself to do the bare minimum, but it wouldn’t be enginnering if the solution didn’t require a bit of effort, so I set out to get some controlable LEDs, a microcontroller and the shittiest plastic chirstmas tree amazon could deliver and got to work. it was around a 6 hours worth of effort from setting up the tree, lights, project, base state machine for patterns and coming up with different patterns to program, fastLED, a LED controlling library made interfacing with the LEDs incredibly easy and lets me use HSV values! which is great for modifications like slight hue change of breathing, blinking and hue changing effects. This post was meant to go live long ago, but life got busy, I only have a single picture to show here, but who knows, maybe watch out for next Christmas’s post.

Awesome, before continuing I need to setup a bit of groudwork, by having a pattern be defined as a virtual class I can have other patterns inherit from it for a speedier development, we have them work like state machines, and initializer, a loop and an destructor. The code is a bit all over the place since I was not refactoring the code and just made changes as I went, but you’ll see the initialization usually set the colors up and the loop doing the necessary math to move things around.
I made a total of 8 patterns, some better than others, people were pretty happy to see some holiday spirit at the office which was nice, but I did have some other ideas that went un-programmed, 8 patterns is not much, well, if you’re working 9 hours a day and having them change every 20 minutes, it’s difficult to set a good amount of patterns with fixed colors, so an idea to separate patterns and colors came to mind, having a pattern’s init randomly select from a list of colors pallets and apply it to the patterns logic instead of having fixed ones, this might work for excentric patterns but it’s also good to have some fixed christmas-y colors + patterns from time to time so it might be good to excersice restraint one randomizing everything. Another possibility would be to host a website, esps are strong enough to serve static websites and having people be able to make their own color pallets and assign a pattern to it would be fun, while assigning having the whole tree update the color to preview what they’d be choosing would be a nice way to instantly show what the LEDs would look like since the ones I got at least aren’t that good and has a big discrepancy between what they look like in real life and what it’s values counterparts look like.
You can find this Christmas LED project on my git.
