MajicDesigns / MD_Parola

Library for modular scrolling LED matrix text displays
GNU Lesser General Public License v2.1
438 stars 135 forks source link

Detect end of string #36

Closed michelep closed 5 years ago

michelep commented 5 years ago

How i can detect the end of a string scrolling ? I.E. to detect when i can change the display string ?

MajicDesigns commented 5 years ago

As per the documentation:

"The calling program should monitor the return value [of displayAnimate()] for 'true' in order to either reset the zone animation or supply another string for display. A 'true' return value means that one or more zones have completed their animation."

The displayAnimate() method returns true when the animation is completed. This is when you should change the message if required. See many examples that show this happening (eg Parola_Scrolling.ino)

michelep commented 5 years ago

Sorry, i'm using MD_MAX72XX library and displayAnimate() seems to be not included.

MajicDesigns commented 5 years ago

You raised the issue in the MD_Parola repository, so you got an answer for MD_Parola.

With MD_MAX72xx there is nothing to help you, You need to work it out for yourself by keeping track of where the text is. This should not be hard as you are doing all the scrolling animation in your code anyway.

In the MD_Parola code, I count all the empty columns in the display 'after' (depends on which direction is being scrolled) the text being displayed . When these empty columns equal number of columns in the display the text has completely scrolled off and the animation is complete.

MajicDesigns commented 5 years ago

Closed due to lack of comms from OP