Page 1 of 1

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

Posted: Thu Sep 26, 2019 12:21 pm
by mrdion
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

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

Posted: Thu Sep 26, 2019 10:39 pm
by Brissieboy
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.

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

Posted: Thu Sep 26, 2019 11:18 pm
by mrdion
Thanks, i will try dmd library.