I am working on trying to animate things on this matrix just off of the arduino Mega board. i was thinking hexidecimal asignment for 120. if you check out my username on Youtube(same as here) you will see what I am working on. I have been having lots of fun with the board, but trying to make my animations run better is what i am looking to do. Please Help, and thank you.
int row[] = {
1,2,3,4,5,6,7,8,9,10,11,12};
int col[] = {
31,30,29,28,27,26,25,24,23,22};
int br = 42;
int rb = 43;
int br2 = 44;
int rb2 = 45;
int br3 = 46;
int rb3 = 47;
int rowe[] = {
0, 1, 0, 1, 1, 2, 1, 2, 2, 3, 3, 4, 3, 4, 4, 3, 4, 3, 3};
int rows[] = {
10, 9, 10, 9, 9, 8, 9, 8, 8, 7, 8, 7, 7, 6, 7, 6, 6, 7, 6, 6};
int rowt = 20;
void setup() {
for (int thispin = 0; thispin < 12; thispin++) {
pinMode(row[thispin], OUTPUT);
}
pinMode(br, OUTPUT);
pinMode(rb, OUTPUT);
pinMode(br2, OUTPUT);
pinMode(rb2, OUTPUT);
pinMode(br3, OUTPUT);
pinMode(rb3, OUTPUT);
for (int thispin1 = 0; thispin1 < 10; thispin1++) {
pinMode(col[thispin1], OUTPUT);
digitalWrite(col[thispin1], HIGH);
}
}
void loop() {
for (int thisfg = 0; thisfg < rowt; thisfg++) {
for (int thisfg1 = 0; thisfg1 < rowt; thisfg1++) {
digitalWrite(rb, HIGH);
digitalWrite(br2, LOW);
digitalWrite(rb2, HIGH);
for (int thiscol = rowe[thisfg1]; thiscol < rows[thisfg]; thiscol++) {
digitalWrite(col[thiscol], LOW);
for (int thisrow = 0; thisrow <12; thisrow++) {
digitalWrite(row[thisrow], HIGH);
delay(1);
digitalWrite(row[thisrow], LOW);
}
digitalWrite(col[thiscol], HIGH);
digitalWrite(br2, HIGH);
}
digitalWrite(br, LOW);
digitalWrite(rb, HIGH);
digitalWrite(br2, HIGH);
digitalWrite(rb2, LOW);
for (int thiscol = rowe[thisfg]; thiscol > rowe[thisfg1]; thiscol--) {
digitalWrite(col[thiscol], LOW);
for (int thisrow = 0; thisrow <12; thisrow++) {
digitalWrite(row[thisrow], HIGH);
delay(1);
digitalWrite(row[thisrow], LOW);
}
digitalWrite(col[thiscol], HIGH);
}
digitalWrite(br, HIGH);
digitalWrite(rb, LOW);
digitalWrite(br2, HIGH);
}
}
digitalWrite(br3, LOW);
digitalWrite(rb3, HIGH);
delay(100);
digitalWrite(br3, HIGH);
digitalWrite(rb3, LOW);
delay(100);
digitalWrite(br3, LOW);
}