0

I've been struggling in this issue for a long time, I know there are people who have done it.

But, I don't have much experience in C to have the skills to design or develop such complicated functions.

I want to scroll data, e.g. text, chars or numbers just like the nice projects in YouTube about the dot matrix.

Like this one: How to Make a SCROLLING TEXT Display at Home

I know how to display a char, but I don't know how to scroll it. If I try I don't get the results I want.

This is my function for displaying chars:

void draw(void)
{
  s=0;
  uint8_t data_shift_buf;
  for (l=0;l<26;l++)            // to print 26 letters
  {
    for (row=1;row<9;row++)     // for 8 matrix rows
    {

        SPI_TX_m16(data = (row<<8) | (Alphabet[s]),4);// trying set data by column
        s++;_delay_ms(300);
    }
  }
}
10
  • what does this mean ? LED dot matrix throw multiple modules ... what are you throwing?
    – jsotola
    Feb 23, 2018 at 2:35
  • 2
    It's obviously "through". Feel free to improve the question, as I just did.
    – Nick Gammon
    Feb 23, 2018 at 7:13
  • What module do you have exactly? Maybe this will help: gammon.com.au/forum/?id=11516
    – Nick Gammon
    Feb 23, 2018 at 7:20
  • 1
    The very next paragraph under that says: Library updated on 2nd October 2015 to have smooth scrolling. A new example has been added which demonstrates this. To achieve this each for each display module (8 x 8 pixels) the code calculates the pixels for the byte before, the current byte, and the byte after. Then it applies the pixel offset to choose a starting point somewhere in those 24 (horizontally) pixels.
    – Nick Gammon
    Feb 23, 2018 at 19:52
  • 1
    Take a look at the Parola.h library also. github.com/MajicDesigns/MD_Parola It can scroll up, down, left, right, and for large #s of displays.
    – CrossRoads
    Apr 26, 2018 at 0:47

1 Answer 1

0

This is the function for my problem.

void draw(void)
{
uint32_t map_buffer=0;int8_t i,k;
uint8_t data_reg[4] = {0xaa,0xbb,0xff,0xff};      // random data to write
uint8_t dis_buf[4],no_device,no_col;s=0;l=3;

for (i=0;i<4;i++)
map_buffer |= data_reg[i] << i*8;                 // loading data into map_buffer

for (col=0;col<32;col++)                          // for 8 matrix columns
{
    map_buffer >>= 1;                            // start shifting the data by 1 pixel
    for (i=0;i<4;i++)
    dis_buf[i] = map_buffer >> i*8;              // loading shifted data into display buffers
    for (i=0;i<4;i++)
    {
        for (row=1;row<9;row++)                 // for 8 matrix rows
        {
            SPI_TX_m(data = (row<<8) | (dis_buf[i]),i);
        }
    }_delay_ms(1000);
}

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.