As you may recall from my The Worm Turns column, more yonks ago than I care to remember, I created a little worm program that randomly wandered around an 8 x 8 LED array.
Seeing this program in action prompted me to build a 12 x 12 array of ping pong balls, each with a WS2818 tricolor LED (a.k.a. NeoPixel) inside.
Powering this bodacious beauty is an incredibly tasty processor called the Seeeduino XIAO. As small as a postage stamp, this little beauty boasts a 32-bit Arm Cortex-M0+ processor running at 48 MHz with 256 KB of flash memory and 32 KB of SRAM (see Say Hello to the Seeeduino XIAO).
To be honest, the resulting display is better than I’d ever hoped. Take a peek at this video of the little rascal running its first-ever test program.
Actually, I’m amazed how many emails I’ve been receiving asking for more details as to the construction and programming of the array. In fact, there are quite a few videos showing some of this stuff on my Cool Beans YouTube channel.
I’ve also been documenting this in detail in my monthly Cool Beans and Programming Tips and Tricks columns in Practical Electronics (PE), which is the UK’s premier electronics, computing, hobbyist, and maker magazine (PE is available around the world in both print and digital formats).
In fact, I just discovered that the back issues containing my columns are now available for purchase via the magazine’s new PDF Downloader. Furthermore, all of the code files associated with my columns are available from the magazine’s Downloads Page. The publisher tells me that any downloads discussed in the magazine are free, but you do need to create an account. After you’ve created an account, as soon as you’ve completed the “free download purchase” at the checkout, your downloads will be available on your account page.
If you are interested in building a 12 x 12 ping pong ball array for yourself, here’s a brief summary of where we are thus far with the PE issues regarding this project:
Building a 2-ball prototype; should the LEDs be mounted inside or outside the ping-pong balls?
Introducing the Seeeduino XIAO.
Using a “sacrificial” NeoPixel to implement a 3.3V to 5.0V voltage level converter.
Preparing and populating the ping pong balls.
Wiring the pixels.
Adding the power (including power calculations).
Creating the first two test programs.
Testing the contrast.
Implementing random drips (white).
Implementing random drips (color).
At the time of this writing, the September issue of PE hasn’t yet hit the streets (it will become available in the first week of August), but this issue is where things start to get really interesting.
Take the contrast tests, for example. I started to wonder if we needed to compensate for different brightness values associated with each pixel (ping pong ball). Suppose we drive one pixel 100% red, for example. Now consider the four pixels north, south, east, and west of this pixel.
Suppose we drive the north pixel with a combination of red and green to generate yellow, the south pixel with a combination of red and blue to generate magenta, and both the east and west pixels with red, green, and blue to generate white. If all of the sub-colors are being driven to 100%, will this make the red pixel look washed-out by comparison?
To put this another way, in the case of the yellow pixel, should we drive its red and green at 50% to match the 100% of the red pixel on its own? Similarly, for the magenta pixel, should we drive its red and blue at 50% to match the 100% of the red pixel on its own? How about the two white pixels, should we drive their red, green, and blue at 33% to match the 100% of the red pixel on its own?
For the first test of this contrast, I created a simple sketch (program) that an fills an inner 4 x 4 square of pixels with 100% red surrounded by a band of white pixels (illustrated as (a) below). I then alternated the red, green, and blue elements forming the white pixels back and forth between 33% and 100%.
Next, I swapped the colors over so that the outer band of pixels was 100% red, and the inner square of pixels was white (illustrated as (b) below). Once again, I then alternated the red, green, and blue elements forming the white pixels back and forth between 33% and 100%.
What was the result? I’m afraid you’ll have to read the magazine (I’m sorry, but I’ve been sworn to secrecy). Also in the September issue, we create a simple program to make pixels randomly flash white to simulate drips (virtual raindrops) landing on the array. We then change these drips to appear in random colors. All of the code for these programs will be made available on the PE website when the September issue hits the streets. Also, I’ll be posting videos on my Cool Beans Youtube Channel.
I have all sorts of ideas for the future, including sophisticated color fade effects, rainbow effects, and firework effects.
Did you see my RIP Game of Life Creator column? This was a tribute to the late John Horton Conway, who was the originator of the Game of Life, which dragged the concept of cellular automata kicking and screaming out of academia and into the real world. Well, one of the things we are going to do with the 12 x 12 array is implement a simple game of life.
And, of course, in the fullness of time, we will eventually get around to implementing a worm program, which is what we set out to do in the first place. We’ll start with a simple worm that randomly meanders its way around the array. Later, we’ll add a joystick and use it to guide the worm to “food pixels” that randomly appear and disappear on the array. Every time the head of the worm hits one of these food pixels, the worm’s tail will grow by one pixel. Who will be able to grow the largest worm without it getting tangled up?
To be honest, I’m constantly thinking of new displays I can implement with my 12 x 12 array, but I’m always interested in hearing more suggestions, which is a subtle cue for you to start commenting furiously (LOL).