8x8 led matrix custom text with 74hc595

Hello, I made a program for running text on an 8x8 matrix display. Now I want to make it so that the user could input their own text. I can’t seem to find a solution… I know how to split a string into an array of characters, but I don’t know how I can make an array of bytes to display on the matrix… Can anybody help me? Thanks in advance.

uint8_t A[] = {B00000000, B00000000, B01111110, B10010000, B10010000, B01111110, B00000000, B00000000};
uint8_t B[] = {B00000000, B11111110, B10010010, B10010010, B01101100, B00000000, B00000000, B00000000};
uint8_t C[] = {B00000000, B01111100, B10000010, B10000010, B10000010, B10000010, B00000000, B00000000};
uint8_t D[] = {B00000000, B00000000, B11111110, B10000010, B10000010, B10000010, B01111100, B00000000};
uint8_t E[] = {B00000000, B00000000, B11111110, B10010010, B10010010, B10010010, B10010010, B00000000};
uint8_t F[] = {B00000000, B00000000, B11111110, B10010000, B10010000, B10010000, B10010000, B00000000};
uint8_t G[] = {B00000000, B00000000, B01111100, B10000010, B10010010, B10010010, B00001100, B00000000};
uint8_t H[] = {B00000000, B00000000, B11111110, B00010000, B00010000, B11111110, B00000000, B00000000};
uint8_t I[] = {B00000000, B00000000, B10000010, B10000010, B11111110, B11111110, B10000010, B10000010};
uint8_t J[] = {B00000000, B10001100, B10000010, B10000010, B10000010, B11111100, B00000000, B00000000};
uint8_t K[] = {B00000000, B00000000, B11111110, B00010000, B00101000, B01000100, B10000010, B00000000};
uint8_t L[] = {B00000000, B00000000, B11111110, B00000010, B00000010, B00000010, B00000010, B00000000};
uint8_t M[] = {B00000000, B00000000, B11111110, B01000000, B00100000, B01000000, B11111110, B00000000};
uint8_t N[] = {B00000000, B11111110, B01000000, B00110000, B00001000, B00000100, B11111110, B00000000};
uint8_t O[] = {B00000000, B00000000, B01111100, B10000010, B10000010, B10000010, B01111100, B00000000};
uint8_t P[] = {B00000000, B00000000, B11111110, B10010000, B10010000, B01100000, B00000000, B00000000};
uint8_t Q[] = {B01111100, B10000010, B10000010, B10001010, B10000110, B01111110, B00000001, B00000000};
uint8_t R[] = {B00000000, B11111110, B10010000, B10010000, B01101100, B00000010, B00000000, B00000000};
uint8_t S[] = {B00000000, B01100100, B10010010, B10010010, B10010010, B01001100, B00000000, B00000000};
uint8_t T[] = {B00000000, B00000000, B10000000, B10000000, B11111110, B10000000, B10000000, B00000000};
uint8_t U[] = {B00000000, B00000000, B11111100, B00000010, B00000010, B00000010, B11111100, B00000000};
uint8_t V[] = {B00000000, B11000000, B00111000, B00000100, B00000010, B00000100, B00111000, B11000000};
uint8_t W[] = {B00000000, B11111000, B00000100, B00001000, B11110000, B00001000, B00000100, B11111000};
uint8_t X[] = {B00000000, B10000010, B01000100, B00101000, B00010000, B00101000, B01000100, B10000010};
uint8_t Y[] = {B00000000, B10000000, B01000000, B00100000, B00011110, B00100000, B01000000, B10000000};
uint8_t Z[] = {B00000000, B00000000, B10000110, B10001010, B10010010, B10100010, B11000010, B00000000};

boolean smer = true;

unsigned int rychlost =50;

unsigned char dolu = LSBFIRST;
unsigned char nahoru = MSBFIRST;

unsigned char smerStr = nahoru;

const int latchPin = 12; //ST_CP
const int clockPin = 8;//SH_CP
const int dataPin = 11; //DS




unsigned char  tab[] = {0b01111111, 0b10111111, 0b11011111, 0b11101111, 0b11110111, 0b11111011, 0b11111101, 0b11111110};

unsigned int text[] = {A[0], A[1], A[2], A[3], A[4], A[5], A[6], A[7], B[1], B[2], B[3], B[4], B[5], B[6], B[7]};

unsigned int sizeArr = (sizeof(veta) / 2);

void setup ()
{

 
 pinMode(latchPin, OUTPUT);
 pinMode(clockPin, OUTPUT);
 pinMode(dataPin, OUTPUT);



}

void loop()
{




 }
 for (int n = 0; n < 5; n++)
 {

   for (int t = 0; t < rychlost; t++)
   {

     for (int num = n; num < 8 + n; num++)
     {
       shiftOut(dataPin, clockPin, smerStr, text[num]);
       shiftOut(dataPin, clockPin, smerStr, tab[num - n]);
     
       digitalWrite(latchPin, HIGH);
       digitalWrite(latchPin, LOW);
     }

   }
 }
}

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.