3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

GUI Controlled LED Matrix

Step 4Programming the Arduino

Programming the Arduino
The advantage of building the matrix to be controlled by rows and columns is that you do not need a pin to control every single LED. The downside, however, is that certain LED's cannot be displayed simultaneously without lighting up other unwanted LED's. To prevent unwanted LED's from lighting, the you must take advantage of an effect called persistance of vision (POV). To use this effect, the Arduino will actually only light one row of LED's at a time, but it will cycle through the rows so quickly that the image will look solid.

Now, I do not know if there is a standard for how LED displays cycle through the rows/columns, but I wrote my POV controlling program from scratch. If you go down to the basics, it works like this:

The Arduino's code contains a set of arrays (one could also use a single 2D array), one for each row, that indicates which LEDs in the row are activated. The program scans through these arrays one at a time, and the Arduino lights only the LED's which are indicated in the one row. It lights the LED's in the row by setting the pin for the row to "LOW" and the pins for the lit LED's to "HIGH." Every cycle, the program also runs a function which gathers input over a serial connection. Inputs are in the form of integers, which correspond to an LED on the matrix. The matrix is arranged as such:

[0, 1, 2]
[3, 4, 5]
[6, 7, 8]

If the code receives the number "6" over serial, the state of the bottom left LED in the array is switched.

Due to its length, I will not paste the code into this text, but you can download a commented version of it just below:

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
87
Followers
16
Author:Technochicken(BuildIts)