how do you scroll text from far right to left by pixel column properly?

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
mrdion
Posts: 4
Joined: Mon Aug 19, 2019 12:19 am

how do you scroll text from far right to left by pixel column properly?

Post by mrdion » Thu Sep 26, 2019 12:21 pm

Hello,

i am having trouble in making running text from right to left, but like smoothly per column pixels.

Code: Select all

#include <SPI.h>
#include <DMD2.h>
#include <fonts/Arial14.h>

/* For "Hello World" as your message, leave the width at 4 even if you only have one display connected */
#define DISPLAYS_WIDE 5
#define DISPLAYS_HIGH 1

const char *demomsg1 = "This is running text demonstration in DMDP10";

SPIDMD dmd(DISPLAYS_WIDE,DISPLAYS_HIGH);
//DMD_TextBox box(dmd, 0, 0, 32, 16);

int traveldist, loopdist;

// the setup routine runs once when you press reset:
void setup() {
  dmd.setBrightness(255);
  dmd.selectFont(Arial14);
  dmd.begin();

  traveldist = dmd.stringWidth(demomsg1) + (32*5); 
  loopdist = (32*5);
  dmd.drawString(loopdist, 0, demomsg1);
  //dmd.scrollX(-1);
}

// the loop routine runs over and over again forever:
void loop() {
  loopdist--;
  dmd.drawString(loopdist, 0, demomsg1);
  //dmd.scrollX(-1);
  delay(5);
}
it runs like this https://youtu.be/aJC0o2nLva8
before that, i used scrollX function with start position (32*5). but it doesn't appear at all. so, i used drawString instead, but the problem is, it disappear in the middle, like in the video.
anyone can give a hint on what i am doing wrong?

thanks

Brissieboy
Posts: 177
Joined: Fri Sep 20, 2013 7:25 am

Re: how do you scroll text from far right to left by pixel column properly?

Post by Brissieboy » Thu Sep 26, 2019 10:39 pm

I suspect this is a problem with the DMD2 library. It does not handle scrolling text (marquee) very well with multiple DMDs.
You might have greater success with the DMD library. It will not be difficult to give it a try and see how you go.
But you need to be aware that each DMD takes time to update so you must compromise between the number of DMDs and the quality of the display, and also consider how much other work the processor needs to do.

mrdion
Posts: 4
Joined: Mon Aug 19, 2019 12:19 am

Re: how do you scroll text from far right to left by pixel column properly?

Post by mrdion » Thu Sep 26, 2019 11:18 pm

Thanks, i will try dmd library.

Post Reply