Step 4Programming the Arduino
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:
_3x3.pde3 KB| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|











































