PONG on an 8×8 LED Matrix and LoLShield

Being relatively new to electronics in general and microcontrollers in particular, I am still in the “getting excited about blinking lights” phase. So, if a single blinking LED is sort of interesting, how cool are 64 of them? Like Collin Cunningham says in his video “The LED matrix has a bit of a reputation among electronics hobbyists” … and of course, I wanted to play PONG on it.

AS1100 – fully compatible to the MAX7219

I got an 8×8 matrix some time ago, but figured that controlling 64 LEDs from a bare Arduino is a bit painful. Looking for examples, I found projects using current limiting resistors, switching transistors, and 74HC595 shift registers. So in the end, like in Collin’s video, I went for the MAX72xx LED drivers (MAX7219 or MAX7221). Those chips are designed to either drive an 8 digit 7-segment display, or an 8×8 LED matrix. It is a little on the expensive side though. For example, the MAX7219 is EUR 9.15 at Digi-Key. To put this in perspective, the ATmega328P driving the Arduino UNO is EUR 2.71.

But there is an alternative. The AS1100 from austria microsystems is fully compatible to the MAX 7219. Best of all, they do free samples. But otherwise those chips seem to be difficult to get in small quantities. The DIP version for example, is a non-stock item at Digi-Key. If anyone has a source suitable for hobbyists, please leave a comment.

The Build

DSC 6996


DSC 7007

The Code

I wrote my PONG game as an Arduino library and put it on github. The library implements the core of the game. Subclasses of the “Pong” base class implement virtual functions to display the ball, paddle, score, intro animations, etc. on the “screen”, see MatrixPong.ino in the examples directory. This way I was able to re-use the same base code for the LoLShield:

This entry was posted in arduino and tagged , , , . Bookmark the permalink.

One Response to PONG on an 8×8 LED Matrix and LoLShield

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s