DMD scrolling Speed control

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
Sayantan
Posts: 3
Joined: Sat Oct 27, 2018 12:31 pm

DMD scrolling Speed control

Post by Sayantan » Sat Oct 27, 2018 12:39 pm

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.

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

Re: DMD scrolling Speed control

Post by Brissieboy » Sat Oct 27, 2018 10:34 pm

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.

Sayantan
Posts: 3
Joined: Sat Oct 27, 2018 12:31 pm

Re: DMD scrolling Speed control

Post by Sayantan » Sun Oct 28, 2018 11:33 am

Can you please explain a little bit more by giving some example codes that how I supposed to do that. thanks

User avatar
stryker
Posts: 270
Joined: Sat Jan 14, 2012 2:44 pm

Re: DMD scrolling Speed control

Post by stryker » Sun Oct 28, 2018 11:43 am

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

Post Reply