Page 1 of 1

DMD scrolling Speed control

Posted: Sat Oct 27, 2018 12:39 pm
by Sayantan
I am a beginner and I just bought two p10 displays for myself. After trying some prebuild codes available online I found that there's probably one problem with this DMD library that it may not let you control the scrolling Speed easily. Correct me if I am wrong. So if anyone can tell me a way to do that it'd be great. Also I like to control the texts and it's speed remotely using Bluetooth module.

Re: DMD scrolling Speed control

Posted: Sat Oct 27, 2018 10:34 pm
by Brissieboy
Scrolling speed is determined by how often you step the marquee. If you are using the original DMD library this is done by dmd.stepMarquee(), or for DMD2 it is dmd.marqueeScrollX(), which you execute within a timed loop. So all you need to do is adjust the timing of the loop to alter scrolling speed.

Re: DMD scrolling Speed control

Posted: Sun Oct 28, 2018 11:33 am
by Sayantan
Can you please explain a little bit more by giving some example codes that how I supposed to do that. thanks

Re: DMD scrolling Speed control

Posted: Sun Oct 28, 2018 11:43 am
by stryker
If you're using the original DMD library, in the example code "dmd_demo" you'll find this block of code:

Code: Select all

   dmd.drawMarquee("Scrolling Text",14,(32*DISPLAYS_ACROSS)-1,0);
   long start=millis();
   long timer=start;
   boolean ret=false;
   while(!ret){
     if ((timer+30) < millis()) {
       ret=dmd.stepMarquee(-1,0);
       timer=millis();
     }
   }
It steps the marquee text "Scrolling Text" every 30ms. you can adjust the timing by changing the 30 in this line

Code: Select all

     if ((timer+30) < millis()) {
HTH, Geoff