| Parola for Arduino 1.0 Scrolling Text and Effects for Modular Parola Hardware

- Main Page
- Related Pages
- Classes

Designing and Implementing new text effects

Each of the selected text effects is implemented as a function. This makes adding new effects easy.

The effects functions are implemented as finite state machines. The function is called with the frequency set by the setSpeed() method, and the class variable _fsmState holds the state from the last call.

Each function is divided into 2 parts, one implementing the text move IN to the display (when the parameter bIn is true) and the other when the text is moving OUT of the display (bIn false). The first part starts with the INITIALISE state and ends when the state is set to PAUSE. The second phase starts with a PAUSE state and ends when the state is set to END. Because the IN and OUT effects can be different for a display cycle, the function must not assume that the first part was ever called just before the second, as this is not likely to be the case. The first phase should always end when the text is in its final position and the second phase should assume the text is in its proper starting position when called. Aside from the INITIALISE state (set by the displayReset() method), all other state changes are under the control of the effect functions.

The effects functions can work in one of 2 ways

- Additive, where the animation frames are incrementally built up to the inal display. In the scenario, the function will need to use the getFirst and getNext methods as it builds up the display column by column.
- Subtractive, where the final display is put into the buffers and the elements that are not yet visible are removed. The helper function commonPrint() is used to consistently display the end result.

Which method is used depends on the animation and what is convenient to for the coder, and examples of both are found in the standard library text effects.

The Parola library is implemented using the MD_MAX72xx library for hardware control. The origin for the LED matrix is on the top right of the display. This makes the leftmost column coordinate a higher column number that the one on the far right. Sometimes this is not intuitive when coding and is worth remembering. Rows are numbered from top to bottom.