Instructables

5x5 LED matrix powered by Hackduino (The Arduino Clone)!

Picture of 5x5 LED matrix powered by Hackduino (The Arduino Clone)!
20130802_131113.jpg
20130802_130949.jpg
20130802_130936.jpg
20130802_130929.jpg
20130802_130921.jpg
Hackduino_Logo.png
My dream come true! I finally made an LED matrix! My hackduino was sad. So I used him to control my LED matrix!!! The enclosure was made from a huge sheet of plastic from hobby lobby, and it cost only six dollars! I used my gas solder iron as a blow torch to bend the main part of the enclosure. Then I used hot glue from there. I used my electric solder iron (This one actually works) to solder the hackduino, voltage regulator, and LED matrix onto perfboard.

How to build Hackduino:
http://www.instructables.com/id/Perfboard-Hackduino-Arduino-compatible-circuit/

Guide to LEDs:
https://www.youtube.com/watch?v=P3PDLsJQcGI

Guide to transistors:
https://www.youtube.com/watch?v=-td7YT-Pums
JesusGeek (author) 11 months ago
Code for the 5x5 LED matrix:

/*
Code written like all night by JesusGeek.
8/1/2013
Around 12:00 AM or something like that.
IDC, just give me chocolate and a Bible plz.

Code License:
by-nc-sa
Learn More: http://creativecommons.org/licenses/by-nc-sa/2.0/

This is for a 5x5 LED matrix.
Use transistors for the Cx pins.
Connect those to Digital Supply Voltage.
Connect transitors to the LED cathodes.
Connect the anodes to Rx pins.
*/

const int R1 = 0;
const int R2 = 1;
const int R3 = 2;
const int R4 = 3;
const int R5 = 4;

const int C1 = 9;
const int C2 = 10;
const int C3 = 11;
const int C4 = 12;
const int C5 = 13;

void setup() {
pinMode(R1, OUTPUT);
pinMode(R2, OUTPUT);
pinMode(R3, OUTPUT);
pinMode(R4, OUTPUT);
pinMode(R5, OUTPUT);
pinMode(C1, OUTPUT);
pinMode(C2, OUTPUT);
pinMode(C3, OUTPUT);
pinMode(C4, OUTPUT);
pinMode(C5, OUTPUT);
digitalWrite(R1, LOW);
digitalWrite(R2, LOW);
digitalWrite(R3, LOW);
digitalWrite(R4, LOW);
digitalWrite(R5, LOW);
digitalWrite(C1, LOW);
digitalWrite(C2, LOW);
digitalWrite(C3, LOW);
digitalWrite(C4, LOW);
digitalWrite(C5, LOW);
}

void loop() {
digitalWrite(C1, HIGH);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(C1, LOW);
digitalWrite(C2, HIGH);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(C2, LOW);
digitalWrite(C3, HIGH);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(C3, LOW);
digitalWrite(C4, HIGH);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(C4, LOW);
digitalWrite(C5, HIGH);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(C5, LOW);
digitalWrite(R1, HIGH);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(R1, LOW);
digitalWrite(R2, HIGH);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(R2, LOW);
digitalWrite(R3, HIGH);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(R3, LOW);
digitalWrite(R4, HIGH);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(R4, LOW);
digitalWrite(R5, HIGH);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(R5, LOW);
delay(50); //it flips over here
digitalWrite(C5, HIGH);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(C5, LOW);
digitalWrite(C4, HIGH);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(C4, LOW);
digitalWrite(C3, HIGH);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(C3, LOW);
digitalWrite(C2, HIGH);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(C2, LOW);
digitalWrite(C1, HIGH);
digitalWrite(R5, HIGH);
delay(50);
digitalWrite(R5, LOW);
digitalWrite(R4, HIGH);
delay(50);
digitalWrite(R4, LOW);
digitalWrite(R3, HIGH);
delay(50);
digitalWrite(R3, LOW);
digitalWrite(R2, HIGH);
delay(50);
digitalWrite(R2, LOW);
digitalWrite(R1, HIGH);
delay(50);
digitalWrite(R1, LOW);
digitalWrite(C1, LOW);
digitalWrite(R5, HIGH);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(R5, LOW);
digitalWrite(R4, HIGH);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(R4, LOW);
digitalWrite(R3, HIGH);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(R3, LOW);
digitalWrite(R2, HIGH);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(R2, LOW);
digitalWrite(R1, HIGH);
digitalWrite(C5, HIGH);
delay(50);
digitalWrite(C5, LOW);
digitalWrite(C4, HIGH);
delay(50);
digitalWrite(C4, LOW);
digitalWrite(C3, HIGH);
delay(50);
digitalWrite(C3, LOW);
digitalWrite(C2, HIGH);
delay(50);
digitalWrite(C2, LOW);
digitalWrite(C1, HIGH);
delay(50);
digitalWrite(C1, LOW);
digitalWrite(R1, LOW);
delay(500);
}