Scanning 1,024 LEDs is not a trivial matter — especially when you are going to use an Arduino Uno for all the computation. Output lines are restricted, and what one needs is some hardware
to help with the scanning so the Arduino is free to do
other things. While searching the Internet for ideas, I came
across some red 8x8 LED matrix units that were mounted
on a small board with a Maxim 7219 driver chip. These
could be cascaded, and a decent software library for the
Arduino was available to drive 16 of these units in a
32x32 array.
Just as this project was getting finished, I came across
Adafruit’s LED matrix panels. Their medium size 32x32
RGB panel looked really interesting. Their entire matrix
was in one unit; it was RGB, so you have 3,072 LEDs to
play with; they had supporting software, detailed
instructions and examples on how to get the units wired
and working; and the price was right.
The Game of Life
My imagination started to expand on the idea of
putting a digital clock on one of these RGB panels. While
thinking about how to add an interesting graphical display,
the idea of adding Conway’s Game of Life came to mind.
If you are not familiar with the Game of Life, refer to the
sidebar here or for more details, refer to the many web
pages available on this subject.
Basically, the Game of Life is a variety of cellular
automata that is generated using an array of cells. We will
be using Adafruit’s 32x32 panel of LEDs to represent
these cells. You can begin by either illuminating a number
of specific LED cells in a pattern, or just setting a random
number of cells on. For the next generation, each cell and
its eight neighbors are examined.
If a cell is on (LED illuminated), it will stay on if it has
either two or three neighbors in the eight cells
surrounding it. Otherwise, it will be off in the next
generation. If a cell is off but has three neighbors that are
on surrounding it, this cell will be on in the next
generation. It is important to realize that one must create
the new generation without any changes to the existing
generation. Our Arduino sketch will need to maintain two
32x32 arrays to do this. What one sees as each generation
is displayed is ever changing and flowing ornate patterns of
cells that are simply created based on the previous
generation.
●●●●
July 2014 25
■ FIGURE 2.
The reverse
side of the
Adafruit 32x32
RGB matrix
panel, showing
its power cable
plugged in and
the ribbon cable
connecting it to
the Arduino
Mega 2560
board using a
blank project
shield.