Professional Documents
Culture Documents
5 X 5
5 X 5
h>
//matrix 5x5
//se declara
int temCol =
//se declara
int temFil =
{ \
1, 0}, \
0, 1}, \
1, 0}, \
0, 1}, \
1, 0} \
#define C
{1, 1, 1,
{1, 0, 0,
{1, 0, 0,
{1, 0, 0,
{1, 1, 1,
}
{ \
1, 1}, \
0, 0}, \
0, 0}, \
0, 0}, \
1, 1} \
#define D
{1, 1, 1,
{1, 0, 0,
{1, 0, 0,
{1, 0, 0,
{1, 1, 1,
}
{ \
1, 0}, \
0, 1}, \
0, 1}, \
0, 1}, \
1, 0} \
#define E
{1, 1, 1,
{1, 0, 0,
{1, 1, 1,
{1, 0, 0,
{1, 1, 1,
}
{ \
1, 1}, \
0, 0}, \
1, 1}, \
0, 0}, \
1, 1} \
#define F
{1, 1, 1,
{1, 0, 0,
{1, 1, 1,
{1, 0, 0,
{1, 0, 0,
}
{ \
1, 1}, \
0, 0}, \
1, 0}, \
0, 0}, \
0, 0} \
#define G
{1, 0, 1,
{1, 0, 0,
{1, 1, 1,
{1, 0, 0,
{1, 1, 1,
}
{ \
1, 1}, \
0, 0}, \
1, 1}, \
0, 1}, \
1, 1} \
#define H
{1, 0, 0,
{1, 0, 0,
{1, 1, 1,
{1, 0, 0,
{1, 0, 0,
}
{ \
0, 1}, \
0, 1}, \
1, 1}, \
0, 1}, \
0, 1} \
#define I
{1, 1, 1,
{0, 0, 1,
{0, 0, 1,
{0, 0, 1,
{1, 1, 1,
}
{ \
1, 1}, \
0, 0}, \
0, 0}, \
0, 0}, \
1, 1} \
#define J
{1, 1, 1,
{1, 0, 1,
{0, 0, 1,
{0, 0, 1,
{1, 1, 1,
}
{ \
1, 1}, \
0, 0}, \
0, 0}, \
0, 0}, \
0, 0} \
#define K
{1, 0, 0,
{1, 0, 0,
{1, 1, 1,
{1, 0, 0,
{1, 0, 0,
}
{ \
0, 1}, \
1, 0}, \
0, 0}, \
1, 0}, \
0, 1} \
#define L
{1, 0, 0,
{1, 0, 0,
{1, 0, 0,
{1, 0, 0,
{1, 1, 1,
}
{ \
0, 0}, \
0, 0}, \
0, 0}, \
0, 0}, \
1, 1} \
#define M
{1, 1, 0,
{1, 0, 1,
{1, 0, 0,
{1, 0, 0,
{1, 0, 0,
}
{ \
1, 1}, \
0, 1}, \
0, 1}, \
0, 1}, \
0, 1} \
#define N { \
{1,
{1,
{1,
{1,
{1,
}
0,
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
1}, \
1}, \
1}, \
1}, \
1} \
#define O
{1, 1, 1,
{1, 0, 0,
{1, 0, 0,
{1, 0, 0,
{1, 1, 1,
}
{ \
1, 1}, \
0, 1}, \
0, 1}, \
0, 1}, \
1, 1} \
#define P
{1, 1, 1,
{1, 0, 0,
{1, 1, 1,
{1, 0, 0,
{1, 0, 0,
}
{ \
1, 1}, \
0, 1}, \
1, 1}, \
0, 0}, \
0, 0} \
#define Q
{1, 1, 1,
{1, 0, 0,
{1, 0, 0,
{1, 0, 0,
{1, 1, 1,
}
{ \
1, 1}, \
0, 1}, \
0, 1}, \
1, 1}, \
1, 1} \
#define R
{1, 1, 1,
{1, 0, 0,
{1, 1, 1,
{1, 0, 0,
{1, 0, 0,
}
{ \
1, 0}, \
0, 1}, \
1, 0}, \
1, 0}, \
0, 1} \
#define S
{0, 1, 1,
{1, 0, 0,
{0, 1, 1,
{0, 0, 0,
{1, 1, 1,
}
{ \
1, 1}, \
0, 0}, \
1, 0}, \
0, 1}, \
1, 0} \
#define T
{1, 1, 1,
{0, 0, 1,
{0, 0, 1,
{0, 0, 1,
{0, 0, 1,
}
{ \
1, 1}, \
0, 0}, \
0, 0}, \
0, 0}, \
0, 0} \
#define U { \
{1, 0, 0, 0, 1}, \
{1,
{1,
{1,
{1,
}
0,
0,
0,
1,
0,
0,
0,
1,
0,
0,
0,
1,
1}, \
1}, \
1}, \
1} \
#define V
{1, 0, 0,
{1, 0, 0,
{1, 0, 0,
{0, 1, 0,
{0, 0, 1,
}
{ \
0, 1}, \
0, 1}, \
0, 1}, \
1, 0}, \
0, 0} \
#define W
{1, 0, 0,
{1, 0, 0,
{1, 0, 1,
{1, 1, 0,
{1, 0, 0,
}
{ \
0, 1}, \
0, 1}, \
0, 1}, \
1, 1}, \
0, 1} \
#define X
{1, 0, 0,
{0, 1, 0,
{0, 0, 1,
{0, 1, 0,
{1, 0, 0,
}
{ \
0, 1}, \
1, 0}, \
0, 0}, \
1, 0}, \
0, 1} \
#define Y
{1, 0, 0,
{1, 0, 0,
{0, 1, 1,
{0, 0, 1,
{0, 0, 1,
}
{ \
0, 1}, \
0, 1}, \
1, 0}, \
0, 0}, \
0, 0} \
#define Z
{1, 1, 1,
{1, 0, 0,
{0, 0, 1,
{0, 1, 0,
{1, 1, 1,
}
{ \
1, 1}, \
1, 0}, \
0, 0}, \
0, 1}, \
1, 1} \
#define blanco { \
{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} \
}
//se declara la variable col2 de tipo intero enicializada en 0
int col2 = 0;
//se declara la variable tiempoEspera de tipo entero inicializada en 150
col2 = 0;
}
for (int row2 = 0; row2 < 8; row2++) {
if (matrixLeds[row2][col2] == 1) {
digitalWrite(fil[row2], HIGH);
}
else {
digitalWrite(fil[row2], LOW);
}
}
digitalWrite(col[col2], LOW);
}
CODIGO PROCESSING
import controlP5.*;
//se carga la libreria Serial
import processing.serial.*;
// definir la variable cp5 del tipo ControlP5
ControlP5 cp5;
// definir la variable puerto del tipo Serial
Serial puerto;
// definir la variable text del tipo Textfield
Textfield text;
void setup(){
//tamao de la ventana
size(250,160);
//se crea el objeto controlP5
cp5 = new ControlP5(this);
text = cp5.addTextfield("text")
.setPosition(20,30)
.setSize(200,40)
.setFont(createFont("arial",20))
.setAutoClear(false);
cp5.addButton("Enviar")
.setValue(1)
.setPosition(20,100)
.setSize(40,30)
.setId(2);
String COM = Serial.list()[0];
//comunicacion serial a 9600bps
puerto = new Serial(this, COM, 9600);
}
void draw(){
background(#000000);
}
void controlEvent(ControlEvent theEvent){
if(theEvent.isAssignableFrom(Button.class)){
//se envia cada caracter de la cadena
for(int i = 0; i < text.getText().length(); i++){