Go Down

Topic: Girar texto en matrix 7219 4 celdas (Read 2489 times) previous topic - next topic

aeol2000

Jan 17, 2017, 05:03 pm Last Edit: Jan 20, 2017, 10:17 am by aeol2000 Reason: foto
Compré una matriz de 4 celdas de 8 leds, y al usar las libreria max7219 el texto aparece en vertical, incluso hace scroll por las celdas, pero de manera vertical como se ve en la imagen. Necesito rotar el texto de manera que haga el scroll continuo en horizontal.
Adjunto una foto para entenderlo mejor.

surbyte

Coloca el código que usas y mira las instrucciones por Privado para que la imagen se vea directamente para beneficio de todos.

aeol2000

#2
Jan 20, 2017, 10:19 am Last Edit: Jan 21, 2017, 04:41 pm by aeol2000
Gracias por responder,
el codigo es el del ejemplo:
Code: [Select]
#include <MAX7219.h>

int data = 8;    // DIN pin of MAX7219 module
int load = 9;    // CS pin of MAX7219 module
int clock = 10;  // CLK pin of MAX7219 module

byte char_code[95][6] = {
{B00000000, B00000000, B00000000, B00000000, B00000000, B00000000}, // space
{B01011111, B00000000, B00000000, B00000000, B00000000, B00000000}, // !
{B00000011, B00000000, B00000011, B00000000, B00000000, B00000000}, // "
{B00010100, B00111110, B00010100, B00111110, B00010100, B00000000}, // #
{B00100100, B01101010, B00101011, B00010010, B00000000, B00000000}, // $
{B01100011, B00010011, B00001000, B01100100, B01100011, B00000000}, // %
{B00110110, B01001001, B01010110, B00100000, B01010000, B00000000}, // &
{B00000011, B00000000, B00000000, B00000000, B00000000, B00000000}, // '
{B00011100, B00100010, B01000001, B00000000, B00000000, B00000000}, // (
{B01000001, B00100010, B00011100, B00000000, B00000000, B00000000}, // )
{B00101000, B00011000, B00001110, B00011000, B00101000, B00000000}, // *
{B00001000, B00001000, B00111110, B00001000, B00001000, B00000000}, // +
{B10110000, B01110000, B00000000, B00000000, B00000000, B00000000}, // ,
{B00001000, B00001000, B00001000, B00001000, B00000000, B00000000}, // -
{B01100000, B01100000, B00000000, B00000000, B00000000, B00000000}, // .
{B01100000, B00011000, B00000110, B00000001, B00000000, B00000000}, // /
{B00111110, B01000001, B01000001, B00111110, B00000000, B00000000}, // 0
{B01000010, B01111111, B01000000, B00000000, B00000000, B00000000}, // 1
{B01100010, B01010001, B01001001, B01000110, B00000000, B00000000}, // 2
{B00100010, B01000001, B01001001, B00110110, B00000000, B00000000}, // 3
{B00011000, B00010100, B00010010, B01111111, B00000000, B00000000}, // 4
{B00100111, B01000101, B01000101, B00111001, B00000000, B00000000}, // 5
{B00111110, B01001001, B01001001, B00110000, B00000000, B00000000}, // 6
{B01100001, B00010001, B00001001, B00000111, B00000000, B00000000}, // 7
{B00110110, B01001001, B01001001, B00110110, B00000000, B00000000}, // 8
{B00000110, B01001001, B01001001, B00111110, B00000000, B00000000}, // 9
{B00010100, B00000000, B00000000, B00000000, B00000000, B00000000}, // :
{B10000000, B01010000, B00000000, B00000000, B00000000, B00000000}, // ;
{B00001000, B00010100, B00100010, B00000000, B00000000, B00000000}, // <
{B00010100, B00010100, B00010100, B00000000, B00000000, B00000000}, // =
{B00100010, B00010100, B00001000, B00000000, B00000000, B00000000}, // >
{B00000010, B01011001, B00001001, B00000110, B00000000, B00000000}, // ?
{B00111110, B01001001, B01010101, B01011101, B00001110, B00000000}, // @
{B01111110, B00010001, B00010001, B01111110, B00000000, B00000000}, // A
{B01111111, B01001001, B01001001, B00110110, B00000000, B00000000}, // B
{B00111110, B01000001, B01000001, B00100010, B00000000, B00000000}, // C
{B01111111, B01000001, B01000001, B00111110, B00000000, B00000000}, // D
{B01111111, B01001001, B01001001, B01000001, B00000000, B00000000}, // E
{B01111111, B00001001, B00001001, B00000001, B00000000, B00000000}, // F
{B00111110, B01000001, B01001001, B01111010, B00000000, B00000000}, // G
{B01111111, B00001000, B00001000, B01111111, B00000000, B00000000}, // H
{B01000001, B01111111, B01000001, B00000000, B00000000, B00000000}, // I
{B00110000, B01000000, B01000001, B00111111, B00000000, B00000000}, // J
{B01111111, B00001000, B00010100, B01100011, B00000000, B00000000}, // K
{B01111111, B01000000, B01000000, B01000000, B00000000, B00000000}, // L
{B01111111, B00000010, B00001100, B00000010, B01111111, B00000000}, // M
{B01111111, B00000100, B00001000, B00010000, B01111111, B00000000}, // N
{B00111110, B01000001, B01000001, B00111110, B00000000, B00000000}, // O
{B01111111, B00001001, B00001001, B00000110, B00000000, B00000000}, // P
{B00111110, B01000001, B01000001, B10111110, B00000000, B00000000}, // Q
{B01111111, B00001001, B00001001, B01110110, B00000000, B00000000}, // R
{B01000110, B01001001, B01001001, B00110010, B00000000, B00000000}, // S
{B00000001, B00000001, B01111111, B00000001, B00000001, B00000000}, // T
{B00111111, B01000000, B01000000, B00111111, B00000000, B00000000}, // U
{B00001111, B00110000, B01000000, B00110000, B00001111, B00000000}, // V
{B00111111, B01000000, B00111000, B01000000, B00111111, B00000000}, // W
{B01100011, B00010100, B00001000, B00010100, B01100011, B00000000}, // X
{B00000111, B00001000, B01110000, B00001000, B00000111, B00000000}, // Y
{B01100001, B01010001, B01001001, B01000111, B00000000, B00000000}, // Z
{B01111111, B01000001, B00000000, B00000000, B00000000, B00000000}, // [
{B00000001, B00000110, B00011000, B01100000, B00000000, B00000000}, // \ backslash
{B01000001, B01111111, B00000000, B00000000, B00000000, B00000000}, // ]
{B00000010, B00000001, B00000010, B00000000, B00000000, B00000000}, // hat
{B01000000, B01000000, B01000000, B01000000, B00000000, B00000000}, // _
{B00000001, B00000010, B00000000, B00000000, B00000000, B00000000}, // `
{B00100000, B01010100, B01010100, B01111000, B00000000, B00000000}, // a
{B01111111, B01000100, B01000100, B00111000, B00000000, B00000000}, // b
{B00111000, B01000100, B01000100, B00101000, B00000000, B00000000}, // c
{B00111000, B01000100, B01000100, B01111111, B00000000, B00000000}, // d
{B00111000, B01010100, B01010100, B00011000, B00000000, B00000000}, // e
{B00000100, B01111110, B00000101, B00000000, B00000000, B00000000}, // f
{B10011000, B10100100, B10100100, B01111000, B00000000, B00000000}, // g
{B01111111, B00000100, B00000100, B01111000, B00000000, B00000000}, // h
{B01000100, B01111101, B01000000, B00000000, B00000000, B00000000}, // i
{B01000000, B10000000, B10000100, B01111101, B00000000, B00000000}, // j
{B01111111, B00010000, B00101000, B01000100, B00000000, B00000000}, // k
{B01000001, B01111111, B01000000, B00000000, B00000000, B00000000}, // l
{B01111100, B00000100, B01111100, B00000100, B01111000, B00000000}, // m
{B01111100, B00000100, B00000100, B01111000, B00000000, B00000000}, // n
{B00111000, B01000100, B01000100, B00111000, B00000000, B00000000}, // o
{B11111100, B00100100, B00100100, B00011000, B00000000, B00000000}, // p
{B00011000, B00100100, B00100100, B11111100, B00000000, B00000000}, // q
{B01111100, B00001000, B00000100, B00000100, B00000000, B00000000}, // r
{B01001000, B01010100, B01010100, B00100100, B00000000, B00000000}, // s
{B00000100, B00111111, B01000100, B00000000, B00000000, B00000000}, // t
{B00111100, B01000000, B01000000, B01111100, B00000000, B00000000}, // u
{B00011100, B00100000, B01000000, B00100000, B00011100, B00000000}, // v
{B00111100, B01000000, B00111100, B01000000, B00111100, B00000000}, // w
{B01000100, B00101000, B00010000, B00101000, B01000100, B00000000}, // x
{B10011100, B10100000, B10100000, B01111100, B00000000, B00000000}, // y
{B01100100, B01010100, B01001100, B00000000, B00000000, B00000000}, // z
{B00001000, B00110110, B01000001, B00000000, B00000000, B00000000}, // {
{B01111111, B00000000, B00000000, B00000000, B00000000, B00000000}, // |
{B01000001, B00110110, B00001000, B00000000, B00000000, B00000000}, // }
{B00001000, B00000100, B00001000, B00000100, B00000000, B00000000} // ~
};

MAX7219 dotMatrix(5, data, load, clock);

void setup()
{
dotMatrix.begin();
dotMatrix.scanlimit(0x07);      
dotMatrix.decodemode(0x00);
dotMatrix.shutdown(0x01);    
dotMatrix.displaytest(0x00);
dotMatrix.intensity(0x0f);
dotMatrix.noop(0x00);
dotMatrix.clear();
}

void loop()
{
setStringWithShift("MAX7219 8x8 LED Dot Matrix Cascade!!");
setStringWithShift("For more infomation go to >> blog.edirisinghe.co.uk <<");
}

void setStringWithShift(char* input)
{
dotMatrix.clear();
dotMatrix.reload();
int16_t string_size = -stringSize(input);
int16_t column = 5*8;
for (; column>string_size; column--)
{
setString(input, column);
dotMatrix.reload();
delay(100);
}
}


void setString(char* input, int16_t column)
{
int16_t column_value = column;
while (*input != 0)
{
byte output = *input - 0x20;
for (int y=0; y<6; y++)
{
boolean send = true;
if (char_code[output][y]==B00000000)
if (char_code[output][y-1]==B00000000)
send = false;

if (send)
{
dotMatrix.setData(column_value,char_code[output][y]);
column_value++;
}
}
if (output==0x00)
for (int y=0; y<3; y++)
{
dotMatrix.setData(column_value,char_code[output][y]);
column_value++;
}
input++;
}
}

int stringSize(char* input)
{
int returnX = 0;
while (*input != 0)
{
byte output = *input - 0x20;
for (int y=0; y<6; y++)
{
boolean send = true;
if (char_code[output][y]==B00000000)
if (char_code[output][y-1]==B00000000)
send = false;

if (send)
returnX++;
}
if (output==0x00)
returnX = returnX+3;
input++;
}
return (returnX);
}

surbyte

Gracias por no mirar las instrucciones que te di por privado. No se para que me tomo el trabajo de explicar todo con detalle si luego postean como quieren.


Edita el código para que se vea de acuerdo a las normas!!

RUBENCHO

Hola Buenas tardes necesito ayuda ya que me pasa igual el texto me sale en vertical y ya no hayo que hacer me podrian ayudar

Go Up