PoC del uso de una matriz de 5x7 con Arduino, el codigo usado es el siguiente:

const int col1 = 40;
const int col2 = 41;
const int col3 = 42;
const int col4 = 43;
const int col5 = 44;
const int col6 = 45;
const int col7 = 46;
const int fil1 = 30;
const int fil2 = 31;
const int fil3 = 32;
const int fil4 = 33;
const int fil5 = 34;

const int size = 60;

int matriz0[7][5] = {{1,1,1,1,1},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,1,1,1,1}};
int matriz1[7][5] = {{0,0,1,0,0},{0,1,1,0,0},{1,0,1,0,0},{0,0,1,0,0},{0,0,1,0,0},{0,0,1,0,0},{1,1,1,1,1}};
int matriz2[7][5] = {{0,1,1,1,0},{1,0,0,0,1},{0,0,0,0,1},{0,0,0,1,0},{0,0,1,0,0},{0,1,0,0,0},{1,1,1,1,1}};
int matriz3[7][5] = {{0,1,1,1,0},{1,0,0,0,1},{0,0,0,0,1},{0,0,1,1,0},{0,0,0,0,1},{1,0,0,0,1},{0,1,1,1,0}};
int matriz4[7][5] = {{0,0,0,1,0},{0,0,1,1,0},{0,1,0,1,0},{1,1,1,1,1},{0,0,0,1,0},{0,0,0,1,0},{0,0,0,1,0}};
int matriz5[7][5] = {{1,1,1,1,1},{1,0,0,0,0},{1,0,0,0,0},{1,1,1,1,0},{0,0,0,0,1},{0,0,0,0,1},{1,1,1,1,0}};
int matriz6[7][5] = {{0,1,1,1,1},{1,0,0,0,0},{1,0,0,0,0},{1,1,1,1,0},{1,0,0,0,1},{1,0,0,0,1},{0,1,1,1,0}};
int matriz7[7][5] = {{1,1,1,1,1},{0,0,0,0,1},{0,0,0,1,0},{0,0,1,0,0},{0,0,1,0,0},{0,0,1,0,0},{0,0,1,0,0}};
int matriz8[7][5] = {{0,1,1,1,0},{1,0,0,0,1},{1,0,0,0,1},{0,1,1,1,0},{1,0,0,0,1},{1,0,0,0,1},{0,1,1,1,0}};
int matriz9[7][5] = {{0,1,1,1,0},{1,0,0,0,1},{1,0,0,0,1},{0,1,1,1,1},{0,0,0,0,1},{0,0,0,0,1},{1,1,1,1,0}};
int matrizO[7][5] = {{1,1,1,1,1},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,1,1,1,1}};
int matrizR[7][5] = {{1,1,1,1,0},{1,0,0,0,1},{1,0,0,0,1},{1,1,1,1,0},{1,0,1,0,0},{1,0,0,1,0},{1,0,0,0,1}};
int matrizP[7][5] = {{1,1,1,1,0},{1,0,0,0,1},{1,0,0,0,1},{1,1,1,1,0},{1,0,0,0,0},{1,0,0,0,0},{1,0,0,0,0}};
int matrizE[7][5] = {{1,1,1,1,1},{1,0,0,0,0},{1,0,0,0,0},{1,1,1,1,0},{1,0,0,0,0},{1,0,0,0,0},{1,1,1,1,1}};
int matrizH[7][5] = {{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,1,1,1,1},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1}};
int matrizDot[7][5] = {{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,1,1,1,0},{0,1,1,1,0},{0,1,1,1,0}};
int marquezina[7][size] = {{0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,0,1,0,0,1,1,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,0,0,1,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,1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0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,0},{0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0},{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};

void setup() {
pinMode(col1, OUTPUT);
pinMode(col2, OUTPUT);
pinMode(col3, OUTPUT);
pinMode(col4, OUTPUT);
pinMode(col5, OUTPUT);
pinMode(col6, OUTPUT);
pinMode(col7, OUTPUT);
pinMode(fil1, OUTPUT);
pinMode(fil2, OUTPUT);
pinMode(fil3, OUTPUT);
pinMode(fil4, OUTPUT);
pinMode(fil5, OUTPUT);
Serial.begin( 9600 );
}

void loop(){
writeMarquezina(marquezina);
/*writeMatriz(matrizO, 1000);
writeMatriz(matrizR, 1000);
writeMatriz(matrizO, 1000);
writeMatriz(matrizP, 1000);
writeMatriz(matrizH, 1000);
writeMatriz(matrizE, 1000);
writeMatriz(matrizR, 1000);
writeMatriz(matrizDot, 1000);
writeMatriz(matrizDot, 1000);
writeMatriz(matrizDot, 1000);
*/
}

void writeMarquezina(int mat[][60]){
int inicio = 1;
unsigned long time1 = millis();
for(;;){
for(int i = 0; i < 7; i++) {
digitalWrite(getY(i+1),LOW);
for(int j = 0; j < 5; j++) {
digitalWrite(getX(j+1),mat[i][j+inicio]);
}
delay(2);
digitalWrite(getY(i+1),HIGH);
}
if((millis() - time1) >= 100){
time1 = millis();
inicio+=1;
if(inicio >= size){
inicio = 0;
}
}
}
}

void writeMatriz(int mat[][5], int time){
unsigned long time1 = millis();
for(;;){
for(int i = 0; i < 7; i++) {
digitalWrite(getY(i+1),LOW);
for(int j = 0; j < 5; j++) {
digitalWrite(getX(j+1),mat[i][j]);
}
delay(1);
digitalWrite(getY(i+1),HIGH);
}

if((millis() - time1) >= time){
break;
}
}
}

int getX(int x){
switch(x){
case 1:
return fil1;
break;
case 2:
return fil2;
break;
case 3:
return fil3;
break;
case 4:
return fil4;
break;
case 5:
return fil5;
break;
default:
return 0;
}
}

int getY(int y){
switch(y){
case 1:
return col1;
break;
case 2:
return col2;
break;
case 3:
return col3;
break;
case 4:
return col4;
break;
case 5:
return col5;
break;
case 6:
return col6;
break;
case 7:
return col7;
break;
default:
return 0;
}
}

Loading more stuff…

Hmm…it looks like things are taking a while to load. Try again?

Loading videos…