¡Hola! He estado trabajando en un modulo de matriz de LED 24x40 durante mucho tiempo y tengo el problema de que cualquier palabra que pongo me aparece tres veces, y cuando pongo otra palabra las dos se juntan y ya no se lee el mensaje.
El Arduino con el que estoy trabajando es un Arduino Uno, la matriz se energiza con 5 volts y 2.5 Amperes, ademas la matriz es RGA, prende verde, amarillo y ambar.
Este es el codigo:
// Name : LED 24x40 array Driver
// Author : Bob Davis
// Date : 12 May, 2013
// Version : 1.0
//********************************************//
// Pins for the clocks and data
int TCLK = 1;
int OutEnable = 2;
int BSerial = 3;
int Strobe = 4;
int TSerial = 5;
int BCLK = 6;
// arrays to say Arduino
byte Tbitmap[][8] = { //red characters
{0, 4, 10, 17, 17, 31, 17, 17}, //A
{0, 0,0,0,0,0,0,0},
{0, 28, 18, 17, 17, 17, 18, 28}, //D
{0, 0,0,0,0,0,0,0},
{0, 14, 04, 04, 04, 04, 04, 14}, //I
{0, 17, 25, 25, 21, 19, 19, 17}, //N
{0, 14, 17, 17, 17, 17, 17, 14}, //O
};
byte Bbitmap[][8] = { //green characters
{0, 4, 10, 17, 17, 31, 17, 17}, //A
{0, 30, 17, 17, 30, 20, 18, 17}, //R
{0, 0,0,0,0,0,0,0},
{0, 17, 17, 17, 17, 17, 17, 14}, //U
{0, 14, 04, 04, 04, 04, 04, 14}, //I
{0, 0,0,0,0,0,0,0},
{0, 14, 17, 17, 17, 17, 17, 14}, //O
};
// Set the pins to output to the array
void setup() {
pinMode(TCLK, OUTPUT);
pinMode(TSerial, OUTPUT);
pinMode(BCLK, OUTPUT);
pinMode(BSerial, OUTPUT);
pinMode(Strobe, OUTPUT);
pinMode(OutEnable, OUTPUT);
}
void loop() {
for (int row = 0; row < 8; row++){ //there are actually 16 rows
for (int character = 7; character >=0; character--){
for (int shiftbit = 0; shiftbit < 6; shiftbit++){
digitalWrite(TSerial, HIGH);
digitalWrite(BSerial, HIGH);
if bitRead(Tbitmap[character][row],shiftbit) digitalWrite(TSerial, LOW);
if bitRead(Bbitmap[character][row],shiftbit) digitalWrite(BSerial, LOW);
digitalWrite(TCLK, HIGH);
digitalWrite(OutEnable,LOW);
digitalWrite(TCLK, LOW);
digitalWrite(BCLK, HIGH);
digitalWrite(OutEnable, LOW);
digitalWrite(BCLK, LOW);
}}
digitalWrite(OutEnable, HIGH); // turns off display
if (row==0) digitalWrite(OutEnable, LOW); // turns on display
//latch the data
digitalWrite(Strobe, LOW);
digitalWrite(Strobe, HIGH);
digitalWrite(OutEnable, LOW); // turns on display
delay(.1);
}
}