Recently I bought an 8x8 Red LED Display for Rs. 110 ($2) from Lamington Road, Mumbai. I have connected this board to an Arduino board and an accelerometer.

Image for post
Image for post

This display has 64 LEDs but only 16 pins to control them. The LEDs are controlled by multiplexing them. That is each LED is refreshed one after the other like in a TV and this is done so fast that we feel like we are seeing one image. Again same as a TV or your computer CRT or TFT.

Image for post
Image for post

I have put up the code in a Github repository: https://github.com/paramaggarwal/ledmatrix

There is a lot that can be done with the display. Here is what I could do:

Happy face:

Image for post
Image for post

A basic image to show on the display. This used a 2D array to store data.

Image for post
Image for post

This image was generated using code. Next I moved on to patterns:

Then these two use similar code:

Now here is an interesting pattern. It shifts each columns of the image one step further, and the last colmumn becomes the first column. This gives a wavy pattern:

Here is an interesting laughing animation:

Next step was to interface the accelerometer:

Image for post
Image for post

And two games based on this:

Now comes the interesting part, I studied the net for a bouncing algorithm and this is what I could make:

Now I took this algorithm further and made a game out of it:

Finally a complete game with scores et all.

The game is simple, tilt the board to control the ball and break the bricks. Once you break all the bricks, it shows you the scores by drawing as many bricks as your score. The score depends on the time you took to complete the game.

Github repository: https://github.com/paramaggarwal/ledmatrix

Originally published at paramaggarwal.com.

Written by

Software guy. When you try to tell computers what to do, you eventually learn about human nature as well. (http://paramaggarwal.com)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store