MD_Parola: Question about Multi-Zone Text Example

Hi:

I am trying to learn how to use the Parola Library for printing static multi-zone text.
I have specific questions on the library function P.displayZoneText() as used in the
example "Parola_Zone_TimeMsg" that comes with the library. The Setup() section
in the example contains these two lines:

  P.displayZoneText(1, szTime, PA_CENTER, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
  P.displayZoneText(0, szMesg, PA_CENTER, SPEED_TIME, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);

Without any prior experience, it would appear that the above command is how you write text
in an szTime string to a specific zone.
But then the main program loop() never uses the above library command to print/display text again.
The main loop() in the example, as far as I can see, simply copies various messages to either
"szMesg" or "szTime" and does a display animate() or display reset(). How is the actual text
passed to the display zone?

Do the P.displayZoneText() lines in the setup() section create an ongoing association with
the "szTime" string, so that any time you strcat or strcopy into that string, it will display
on the matrix?

I did go to GitHub and read the library page, but I am fairly new at coding this stuff, and
still can't seem to decode how this is updating the text on the display in this example.

Thanks,

Neal

Do the P.displayZoneText() lines in the setup() section create an ongoing association with
the "szTime" string, so that any time you strcat or strcopy into that string, it will display
on the matrix?

Yes.

The pointer to the string buffer never changes. The data in the string changes.

animate() will tell you when the animation is finished. You can then copy the new data in and reset().

Suggest you read the "Parola A to Z" articles at the blog site shown in the message footer below or follow the links from the documentation html pages.

Ah, OK, thanks!

So the "flow chart" goes something like this;

  1. Create association for string variable and display options in setup();
    P.displayZoneText(1, szTime, PA_CENTER, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);

  2. Check the P.displayAnimate() return, so we don't collide with in-progress display,
    only copy new data into your string if animate() says we are done/idle.
    [If using Zones, I should also consider to check P.getZoneStatus(Zone#)]

  3. P.displayReset(Zone#) will go execute on any parameters and strings that you have
    changed above, as well as any P.setTextEffect(a,b,c) that you have used in your loop
    prior to calling displayReset().

Does that sum it up concisely for a beginner?
Thanks again, tonight after work I will review all those blog posts you mention.

You can tell from my other posts that I am having fun learning to use your libraries.
First issue was total number of modules and multiple instances of physical strings.
The next issue was noticing that the displayed string of characters/numbers could
have different length on the physical display due to font usage ( "1" vs. "4" for example),
which is solved by adding the Parola library and using Zones and Justification.

It did not take long last night to get the time label "UTC" and time and date displaying on
one string of 12 modules. Tonight I will add a second string on different pins, see if the
second instance Soft-SPI is fast enough, and try adding zones and justification to keep
the time portion (variable width) from shifting the date around horizontally.

Thanks for all your hard work creating the libraries, and thanks for your patience and
mentoring while I learn how to put these various lego-blocks together.

Cheers,

Neal

Does that sum it up concisely for a beginner?

Pretty much.