The tree is up.
It's nice, but it's not good enough for this channel!
How about making it respond to music?
Or perhaps we'd like it to say "Happy Christmas"!
Happy Christmas everyone! I hope you have a great holiday
Or we can just show a bunch of different animations.
We can show all sorts of geometric patterns and animate them over the tree.
But if you wanted to, you could get quite fancy.
I've kept it pretty simple with wipes from side to side and top to bottom.
But you could really go to town if you wanted to.
I was very tempted to try and rickroll you all but thought better of it.
So what's going on?
Let's find out after this quick plug for the channel sponsor PCBWay...
Do you like PCBs?
Do you want to make a PCB with a weird and wacky color like purple?
Maybe you'd like a flexible PCB?
Or maybe you'd like someone to do some CNC work for you?
Check out the link to PCBWay in the description.
So what's happening?
I've got a string of 200 addressable WS2811 LEDs running up the tree.
I've just put them on as you would a normal set of Christmas lights and I'm using my
self-organizing LEDs project along with an esp32 to drive them.
To make it work we just need to calibrate the position of each led on the string.
This is done using some really simple image processing and a steady hand.
We grab a frame from the camera with all the LEDs turned off and then we light each led in turn.
Grabbing a frame from the camera each time we light an LED we can then simply compare the
unlit frame with the lit frame to calculate the approximate position of the lit LED.
With all the LED positions calculated we then just map whatever image we want onto these locations.
In my implementation, I just create a frame buffer that I can draw an image onto
and then for each LED I work out what color it should be from the drawn image.
There's really nothing clever going on and provided your tree is in the corner of the
room so you don't need a 360-degree mapping you get a pretty good effect.
So let's gather around the roaring fire and have a great Christmas.
I'll see you all in the new year if not before