When I was young, my family had a lightbox as part of our holiday decorations. No one could remember where it came from, probably a garage sale or something. It was extremely simple -- just six old-fashioned "blinker" Christmas tree lights behind a pane of textured acrylic that turned each light into a diamond pattern. The lights blinked on and off at random intervals. Each light was always the same color and there were only six of them, but something about it was... hypnotic.
One year it fell to the floor and broke. No big loss, everyone said, yet I'd never seen another one like it. Since then, I've always wanted to find another one. Years later, when I saw Adafruit's strings of 12mm LED pixels, I knew exactly what I wanted to make...
Of course, this lightbox does much more than the original ever could. The RGB LEDs can create any color. And because it's all controlled by an Arduino, they can create different coordinated patterns instead of just blinking. Read on for descriptions of what the code already does, or you can edit the code to add your own new patterns.
This project's code randomly displays many different patterns. The video below shows specially modified code to demonstrate all the patterns in the following order:
- Blinker bulbs, if old-fashioned blinkers could also fade to different colors, fade to new locations or flicker on/off. Random blinking is the default mode when no other effects are running. The video shows only a 2 second delay between each on/off effect; the unmodified code imposes a random delay.
- Tracers that chase across the field and bounce off the edges. The video first shows one tracer alone, then three simultaneously.
- Rapid scrolling of the entire field. The video shows this happening very suddenly, normally it doesn't follow so closely on the heels of a previous pattern.
- Conway's "Game of Life" (sorta), where each LED lights or fades based on the number of lit neighbors.
- A starfield, which lights all LEDs with a dim background color and random LEDs flare bright white.
- Blinkenleitz (for lack of a better name), where random LEDs flare brightly in random colors against a black background.
- A game of 2048, played randomly. Unfortunately for my ego, random play is nearly as successful as my own.
- Waves of random colors, spreading from a random point and consuming the entire field.
- Undulating/twinkling waves of colors, spreading across the entire field. The effect may remind you of looking up at the light through the surface of rippling water, or a flickering bed of coals in a dying fire, depending on how you like to spend your free time.
TL;DR
Blinking lights are pretty!
Text editor powered by tinymce.