Interrupt Marquee

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
Lenny
Posts: 2
Joined: Sun May 22, 2016 9:52 pm

Interrupt Marquee

Post by Lenny » Sun May 22, 2016 9:56 pm

Hi folks,

Has anyone thought of a way to interrupt scrolling text, rather than waiting for it to finish before the next item is displayed?

I've got a project, where we scroll advertising across the display, but if a certain event happens, we want to kill the scrolling, clear the DMD, and display something else.

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

Re: Interrupt Marquee

Post by stryker » Sun May 22, 2016 10:58 pm

Hi,

If you're using the example marqeue from this page,
It should be easy enough to add the condition for what you're testing to the short marquee loop in your marquee function, as an else...

Code: Select all

while(!ret){
    if ( ( timer+20 ) < millis() ) {
      ret=dmd.stepMarquee( -1 , 0 );
      timer=millis();
    } else 
    if(your-test-condition) { 
      dmd.clearScreen( true );
      return;
    }
  }
That will bust out of the function and end the marquee.

Cheers ! Geoff

Lenny
Posts: 2
Joined: Sun May 22, 2016 9:52 pm

Re: Interrupt Marquee

Post by Lenny » Sun May 22, 2016 11:11 pm

Thanks Geoff,

So obvious now - it was staring me right in the face :)

Cheers!

Post Reply