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);
}
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