scrolling text on RGb led matrix..

Guys, I’m trying to scroll text on common anode 8x8 RGB led matrix in different colors.I’m using four 74hc595 shift registers . I’m using arduino uno R3 to send data to the shift register. Im using this schematic http://www.instructables.com/files/orig/FIN/ZRHR/FUI0XN9E/FINZRHRFUI0XN9E.pdf … Can anyone please help me how to scroll text in diffrent colors…

Post the code you use

Well I’m using a modified code of madworm’s example code at

and here is the link of example code for testing the board
http://www.instructables.com/files/orig/FUR/O8LQ/FUI0T2GI/FURO8LQFUI0T2GI.zip

My board is working properly with this example code. Here is the code i modified to scroll “S” on the matrix in different colors.It has no errors but i’m not getting the proper output on RGB matrix. My aim is to scroll “S” on the matrix from left to right. Here is the code :

well my code is a bit big,so i attached the file.

RGB_Sri_Ram.ino (9.01 KB)

I am a bit confused by that Instructable.
Did you buy the board and the 8x8 LED matrix from him (madworm)?

Nope,,, I prototyped it on a breadboard. By the way lee why did you get that doubt? :stuck_out_tongue: I'm asking about the code to scroll text in different colors using the shiftout technique...

I don’t have your hardware.
I am not an expert like madworm who wrote the instructions,
but I would do the following:

  1. declare a 2-dimensional matrix representing the letter ‘S’
byte letterS[8][8] = {
    {0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 1, 1, 1, 0},
    {0, 0, 0, 1, 1, 1, 1, 0},
    {0, 0, 0, 1, 1, 1, 0, 0},
    {0, 0, 0, 0, 0, 0, 1, 0},
    {0, 0, 0, 0, 0, 0, 1, 0},
    {0, 0, 1, 1, 1, 1, 0, 0},    
  };

you can change what color you want to use by changing the 125,125,125
2.
change loop( ) function to the following

void loop(void)
{
  int iRow;
  int iColumn;
  int savedValue;
 
   for (iRow = 0; iRow < __rows; iRow++)
   {
     //shift value one column to the left

     savedValue = letterS[iRow][0];
     for (iColumn = 0; iColumn < (__leds_per_row - 1); iColumn++)
     {
       letterS[iRow][iColumn] = letterS[iRow][iColumn + 1];
       if (letterS[iRow][iColumn] == 1) 
       {
         // led is on
         set_led_rgb(iRow, iColumn, 125, 125, 125);
       }
       else
       {
         // led is off
         set_led_rgb(iRow, iColumn, 0, 0, 0);
       }
     }
     letterS[iRow][__leds_per_row - 1] = savedValue;
   }

   delay(1000);
}

I will surely try your code ieee. Thanks for the reply. I'll post the result as soon as I test it...

It’s working ieee but not fully,the letter is being scrolled in a 7x8 array. The last column is not showing anything…
This is the code i’m using…

byte letterS[8][8] = {
  {0, 1, 1, 1, 1, 0, 0, 0  },
  {1, 0, 0, 0, 0, 1, 0, 0  },
  {1, 0, 0, 0, 0, 0, 0, 0  },
  {0, 1, 1, 1, 1, 0, 0, 0  },
  {0, 0, 0, 0, 0, 1, 0, 0  },
  {0, 0, 0, 0, 0, 1, 0, 0  },
  {1, 0, 0, 0, 0, 1, 0, 0   },
  {0, 1, 1, 1, 1, 0, 0, 0  },    
};

void loop(void)
{


  int iRow;
  int iColumn;
  int savedValue;

  for (iRow = 0; iRow < __rows; iRow++)
  {
    //shift value one column to the left
    savedValue = letterS[iRow][0];
    for (iColumn = 0; iColumn < (__leds_per_row - 1); iColumn++)
    {
      letterS[iRow][iColumn] = letterS[iRow][iColumn + 1];
      if (letterS[iRow][iColumn] == 1) 
      {
        // led is on
        set_led_rgb(iRow, iColumn, 125, 125, 125);
      }
      else
      {
        // led is off
        set_led_rgb(iRow, iColumn, 0, 0, 0);
      }
    }
    letterS[iRow][__leds_per_row - 1] = savedValue;
  }
  delay(200);

}

I don't have any way to debug the code, because I don't have the 8x8 LED matrix.

All I know is that when I simulate the code in C#, the LEDs shift so that LED[0][0] goes to LED[0][7], etc.

Ieee Thanks for the help,could u help me in one more thing??? I wrote a new code for scrolling text, well not fully but a function is missing in it. Could you help me with the function?? It is the function lightLed in the attached file. It is mentined as " function to be written " in the attached file. This code is for scrolling a string on 8x8 RGB led matrix…

RGB_Sri_Ram_new.ino (12.7 KB)

I would put your message that you want to scroll in the LEDs array.
If your message gets too long, you will run out of space in the Arduino.

Then modify the original loop( ) function slightly.
You loop through the entire message.
Only light the LEDs that fit in the 8 columns of the 8x8 matrix.

byte LEDs[8][16] = {   
  {0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0}
  {0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0}
  {0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0}
  {0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0}
  {0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0}
  {0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0}
  {0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0}
  {0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0}
};

void loop(void)
{
int iRow;
int iColumn;
int savedValue;
int leds_per_row_matrix = 8;
__leds_per_row = 16;

for (iRow = 0; iRow < __rows; iRow++)
{
//shift value one column to the left

savedValue = letterS[iRow][0];
for (iColumn = 0; iColumn < (__leds_per_row - 1); iColumn++)
{
letterS[iRow][iColumn] = letterS[iRow][iColumn + 1];
if ( (letterS[iRow][iColumn] == 1) && (iColumn < leds_per_row_matrix) )
{
// led is on
set_led_rgb(iRow, iColumn, 125, 125, 125);
}
else
{
// led is off
set_led_rgb(iRow, iColumn, 0, 0, 0);
}
}
letterS[iRow][__leds_per_row - 1] = savedValue;
}

delay(1000);
}

Thank you very much ieee. I'll reply about the results soon...

I don’t know what set_led_rgb( ) will react if you get it an invalid column number.

So you may need to do the following:

else
       {
         // led is off
         if (iColumn < leds_per_row_matrix)
         {
           set_led_rgb(iRow, iColumn, 0, 0, 0);
         }
         else
         {
            // do nothing;
          }
       }