Como disse alguém "o tempo não para...", então, segue mais uma brincadeira de gente grande.

/*
Matriz de LED 8x8 controlada pelo CI MAX7219
Pino 12 é conectado no DIN
Pino 11 é conectado no CLK
Pino 10 is connected to LOAD
Ismael Lopes da Silva
*/

#include "LedControl.h"
LedControl lc=LedControl(12,11,10,1);
unsigned long delaytime = 400;

// Tabela afanumerica com letras maiusculas e minusculas
byte vA[8]={B00000000,B01111111,B01001000,B01001000,B01001000,B01111111,B00000000,B00000000};
byte vB[8]={B00000000,B00110110,B01001001,B01001001,B01001001,B01111111,B00000000,B00000000};
byte vC[8]={B00000000,B00100010,B01000001,B01000001,B01000001,B00111110,B00000000,B00000000};
byte vD[8]={B00000000,B00111110,B01000001,B01000001,B01000001,B01111111,B00000000,B00000000};
byte vE[8]={B00000000,B01000001,B01001001,B01001001,B01001001,B01111111,B00000000,B00000000};
byte vF[8]={B00000000,B01000000,B01001000,B01001000,B01001000,B01111111,B00000000,B00000000};
byte vG[8]={B00000000,B00100110,B01001001,B01001001,B01000001,B00111110,B00000000,B00000000};
byte vH[8]={B00000000,B01111111,B00001000,B00001000,B00001000,B01111111,B00000000,B00000000};
byte vI[8]={B00000000,B01000001,B01111111,B01000001,B00000000,B00000000,B00000000,B00000000};
byte vJ[8]={B00000000,B01000000,B01111110,B01000001,B00000001,B00000110,B00000000,B00000000};
byte vK[8]={B00000000,B01000001,B00100010,B00010100,B00001000,B01111111,B00000000,B00000000};
byte vL[8]={B00000000,B00000001,B00000001,B00000001,B00000001,B01111111,B00000000,B00000000};
byte vM[8]={B00000000,B01111111,B00100000,B00010000,B00100000,B01111111,B00000000,B00000000};
byte vN[8]={B00000000,B01111111,B00001000,B00010000,B00100000,B01111111,B00000000,B00000000};
byte vO[8]={B00000000,B00111110,B01000001,B01000001,B01000001,B00111110,B00000000,B00000000};
byte vP[8]={B00000000,B00110000,B01001000,B01001000,B01001000,B00111111,B00000000,B00000000};
byte vQ[8]={B00000000,B00111101,B01000010,B01000101,B01000001,B00111110,B00000000,B00000000};
byte vR[8]={B00000000,B00110001,B01001010,B01001100,B01001000,B00111111,B00000000,B00000000};
byte vS[8]={B00000000,B00100110,B01001001,B01001001,B01001001,B00110010,B00000000,B00000000};
byte vT[8]={B00000000,B01000000,B01000000,B01111111,B01000000,B01000000,B00000000,B00000000};
byte vU[8]={B00000000,B01111110,B00000001,B00000001,B00000001,B01111110,B00000000,B00000000};
byte vV[8]={B00000000,B01111100,B00000010,B00000001,B00000010,B01111100,B00000000,B00000000};
byte vW[8]={B00000000,B01111111,B00000010,B00000100,B00000010,B01111111,B00000000,B00000000};
byte vX[8]={B00000000,B01100011,B00010100,B00001000,B00010100,B01100011,B00000000,B00000000};
byte vY[8]={B00000000,B01100000,B00010000,B00001111,B00010000,B01100000,B00000000,B00000000};
byte vZ[8]={B00000000,B01100001,B01010001,B01001001,B01000101,B01000011,B00000000,B00000000};
byte v0[8]={B00000000,B00111110,B01010001,B01001001,B01000101,B00111110,B00000000,B00000000};
byte v1[8]={B00000000,B00000001,B01111111,B00100001,B00000000,B00000000,B00000000,B00000000};
byte v2[8]={B00000000,B00100001,B01010001,B01001001,B01000101,B00100011,B00000000,B00000000};
byte v3[8]={B00000000,B00110110,B01001001,B01001001,B01001001,B01000001,B00000000,B00000000};
byte v4[8]={B00000000,B01111111,B00001000,B00001000,B00001000,B01110000,B00000000,B00000000};
byte v5[8]={B00000000,B01000110,B01001001,B01001001,B01001001,B01110010,B00000000,B00000000};
byte v6[8]={B00000000,B00101110,B01001001,B01001001,B01001001,B00111110,B00000000,B00000000};
byte v7[8]={B00000000,B00001000,B01111111,B01001000,B01000000,B01000000,B00000000,B00000000};
byte v8[8]={B00000000,B00110110,B01001001,B01001001,B01001001,B00110110,B00000000,B00000000};
byte v9[8]={B00000000,B00111110,B01001001,B01001001,B01001001,B00110010,B00000000,B00000000};
byte va[8]={B00000000,B00000001,B00001110,B00010001,B00010001,B00001110,B00000000,B00000000};
byte vb[8]={B00000000,B00000110,B00001001,B00001001,B00000101,B00111110,B00000000,B00000000};
byte vc[8]={B00000000,B00001010,B00010001,B00010001,B00010001,B00001110,B00000000,B00000000};
byte vd[8]={B00000000,B00111110,B00000101,B00001001,B00001001,B00000110,B00000000,B00000000};
byte ve[8]={B00000000,B00001001,B00010101,B00010101,B00010101,B00001110,B00000000,B00000000};
byte vf[8]={B00000000,B00010000,B00100000,B00100100,B00011111,B00000100,B00000000,B00000000};
byte vg[8]={B00000000,B00001110,B00010101,B00010101,B00010101,B00001001,B00000000,B00000000};
byte vh[8]={B00000000,B00000111,B00001000,B00001000,B00000100,B00111111,B00000000,B00000000};
byte vi[8]={B00000000,B00000001,B00101110,B00000001,B00000000,B00000000,B00000000,B00000000};
byte vj[8]={B00000000,B00001000,B00101110,B00001001,B00000001,B00000010,B00000000,B00000000};
byte vk[8]={B00000000,B00010001,B00001010,B00000100,B00011111,B00000000,B00000000,B00000000};
byte vl[8]={B00000000,B00000001,B00000001,B01111110,B00000000,B00000000,B00000000,B00000000};
byte vm[8]={B00000000,B00001111,B00010000,B00001111,B00010000,B00001111,B00000000,B00000000};
byte vn[8]={B00000000,B00001111,B00010000,B00001111,B00010000,B00000000,B00000000,B00000000};
byte vo[8]={B00000000,B00001110,B00010001,B00010001,B00001110,B00000000,B00000000,B00000000};
byte vp[8]={B00000000,B00011000,B00100100,B00100100,B00100100,B00011111,B00000000,B00000000};
byte vq[8]={B00000000,B00000010,B00011111,B00100100,B00100100,B00011000,B00000000,B00000000};
byte vr[8]={B00000000,B00010000,B00010000,B00001000,B00011111,B00000000,B00000000,B00000000};
byte vs[8]={B00000000,B00010010,B00100101,B00101001,B00010010,B00000000,B00000000,B00000000};
byte vt[8]={B00000000,B00010001,B00111110,B00010000,B00000000,B00000000,B00000000,B00000000};
byte vu[8]={B00000000,B00011110,B00000001,B00000001,B00000001,B00011110,B00000000,B00000000};
byte vv[8]={B00000000,B00011100,B00000010,B00000001,B00000010,B00011100,B00000000,B00000000};
byte vw[8]={B00000000,B00011111,B00000010,B00000100,B00000010,B00011111,B00000000,B00000000};
byte vx[8]={B00000000,B00010001,B00001010,B00000100,B00001010,B00010001,B00000000,B00000000};
byte vy[8]={B00000000,B00010000,B00001000,B00000111,B00001000,B00010000,B00000000,B00000000};
byte vz[8]={B00000000,B00010001,B00011001,B00010101,B00010011,B00010001,B00000000,B00000000};

void setup()
{
lc.shutdown(0,false); // O MAX72XX inicia em modo power-saving, então, invocamos um wakeup
lc.setIntensity(0,8); // Ajusta o brilho dos LEDs para médio
lc.clearDisplay(0); // Limpa o Display
}

void loop()
{
for (int x=0; x<7; x++)
{
lc.setRow(0,x,vA[x]);
}
delay(delaytime);
for (int x=0; x<7; x++)
{
lc.setRow(0,x,vr[x]);
}
delay(delaytime);
for (int x=0; x<7; x++)
{
lc.setRow(0,x,vd[x]);
}
delay(delaytime);
for (int x=0; x<7; x++)
{
lc.setRow(0,x,vu[x]);
}
delay(delaytime);
for (int x=0; x<7; x++)
{
lc.setRow(0,x,vi[x]);
}
delay(delaytime);
for (int x=0; x<7; x++)
{
lc.setRow(0,x,vn[x]);
}
delay(delaytime);
for (int x=0; x<7; x++)
{
lc.setRow(0,x,vo[x]);
}
delay(delaytime);

for (int y=0; y<8; y++)
{
for (int x=0; x<7; x++)
{
lc.setRow(0,x+y,vU[x]);
}
delay(delaytime-200);
}
delay(delaytime);

for (int y=0; y<8; y++)
{
for (int x=0; x<7; x++)
{
lc.setRow(0,x+y,vN[x]);
}
delay(delaytime-200);
}
delay(delaytime);

for (int y=0; y<8; y++)
{
for (int x=0; x<7; x++)
{
lc.setRow(0,x+y,vO[x]);
}
delay(delaytime-200);
}
delay(delaytime);
}

Exibições: 846

Responder esta

Respostas a este tópico

Enxuguei o código usando ponteiros. Ver anexo.

Anexos

Você pode "economizar" alguns bytes usando

#define delaytime 400

Dica: como boa pratica de programação use um nome em maiúsculo para define, assim:

#define DELAYTIME 400

Ou em qualquer outro lugar que vc não precise modificar um valor, dentro de seu programa.

RSS

© 2024   Criado por Marcelo Rodrigues.   Ativado por

Badges  |  Relatar um incidente  |  Termos de serviço