| Parola for Arduino 3.5 Text effects for LED Matrix modular hardware

Public Member Functions | List of all members
MD_Parola Class Reference

`#include <MD_Parola.h>`

Inheritance diagram for MD_Parola:
[legend]
Collaboration diagram for MD_Parola:
[legend]

## Public Member Functions
| MD_Parola (MD_MAX72XX::moduleType_t mod, uint8_t dataPin, uint8_t clkPin, uint8_t csPin, uint8_t numDevices=1)
| MD_Parola (MD_MAX72XX::moduleType_t mod, uint8_t csPin, uint8_t numDevices=1)
void | begin (void)
void | begin (uint8_t numZones)
| ~MD_Parola (void)
Methods for core object control.
bool | displayAnimate (void)
bool | getZoneStatus (uint8_t z)
void | displayClear (void)
void | displayClear (uint8_t z)
void | displayReset (void)
void | displayReset (uint8_t z)
void | displayShutdown (bool b)
void | displaySuspend (bool b)
bool | isAnimationAdvanced (void)
void | getZone (uint8_t z, uint8_t &moduleStart, uint8_t &moduleEnd)
bool | setZone (uint8_t z, uint8_t moduleStart, uint8_t moduleEnd)
Methods for quick start displays.
void | displayScroll (const char *pText, textPosition_t align, textEffect_t effect, uint16_t speed)
void | displayText (const char *pText, textPosition_t align, uint16_t speed, uint16_t pause, textEffect_t effectIn, textEffect_t effectOut=PA_NO_EFFECT)
void | displayZoneText (uint8_t z, const char *pText, textPosition_t align, uint16_t speed, uint16_t pause, textEffect_t effectIn, textEffect_t effectOut=PA_NO_EFFECT)
Support methods for visually adjusting the display.
uint8_t | getCharSpacing (void)
uint8_t | getCharSpacing (uint8_t z)
bool | getInvert (void)
bool | getInvert (uint8_t z)
uint16_t | getPause (void)
uint16_t | getPause (uint8_t z)
uint16_t | getScrollSpacing (void)
uint16_t | getSpeed (void)
uint16_t | getSpeed (uint8_t z)
uint16_t | getSpeedIn (uint8_t z)
uint16_t | getSpeedOut (uint8_t z)
textPosition_t | getTextAlignment (void)
textPosition_t | getTextAlignment (uint8_t z)
uint16_t | getTextColumns (const char *p)
uint16_t | getTextColumns (uint8_t z, const char *p)
boolean | getZoneEffect (uint8_t z, zoneEffect_t ze)
void | setCharSpacing (uint8_t cs)
void | setCharSpacing (uint8_t z, uint8_t cs)
void | setIntensity (uint8_t intensity)
void | setIntensity (uint8_t z, uint8_t intensity)
void | setInvert (uint8_t invert)
void | setInvert (uint8_t z, uint8_t invert)
void | setPause (uint16_t pause)
void | setPause (uint8_t z, uint16_t pause)
void | setScrollSpacing (uint16_t space)
void | setSpeed (uint16_t speed)
void | setSpeedInOut (uint16_t speedIn, uint16_t speedOut)
void | setSpeed (uint8_t z, uint16_t speed)
void | setSpeedInOut (uint8_t z, uint16_t speedIn, uint16_t speedOut)
void | setSpriteData (uint8_t z, const uint8_t *inData, uint8_t inWidth, uint8_t inFrames, const uint8_t *outData, uint8_t outWidth, uint8_t outFrames)
void | setSpriteData (const uint8_t *inData, uint8_t inWidth, uint8_t inFrames, const uint8_t *outData, uint8_t outWidth, uint8_t outFrames)
void | setTextAlignment (textPosition_t ta)
void | setTextAlignment (uint8_t z, textPosition_t ta)
void | setTextBuffer (const char *pb)
void | setTextBuffer (uint8_t z, const char *pb)
void | setTextEffect (textEffect_t effectIn, textEffect_t effectOut)
void | setTextEffect (uint8_t z, textEffect_t effectIn, textEffect_t effectOut)
void | setZoneEffect (uint8_t z, boolean b, zoneEffect_t ze)
void | synchZoneStart (void)
Support methods for fonts and characters.
void | addChar (uint16_t code, uint8_t *data)
bool | addChar (uint8_t z, uint16_t code, uint8_t *data)
void | delChar (uint16_t code)
bool | delChar (uint8_t z, uint16_t code)
MD_MAX72XX::fontType_t * | getFont (uint8_t z)
MD_MAX72XX::fontType_t * | getFont (void)
void | setFont (MD_MAX72XX::fontType_t *fontDef)
void | setFont (uint8_t z, MD_MAX72XX::fontType_t *fontDef)
Support methods for graphics.
MD_MAX72XX * | getGraphicObject (void)
void | getDisplayExtent (uint16_t &startColumn, uint16_t &endColumn)
void | getDisplayExtent (uint8_t z, uint16_t &startColumn, uint16_t &endColumn)
void | getTextExtent (uint16_t &startColumn, uint16_t &endColumn)
void | getTextExtent (uint8_t z, uint16_t &startColumn, uint16_t &endColumn)
Support methods for Print class extension.
virtual size_t | write (uint8_t c)
virtual size_t | write (const char *str)
virtual size_t | write (const uint8_t *buffer, size_t size)

## Detailed Description

Core object for the Parola library. This class contains one or more zones for display.

## Constructor & Destructor Documentation

## ◆ MD_Parola() [1/2]

MD_Parola::MD_Parola | ( | MD_MAX72XX::moduleType_t | mod,
|  | uint8_t | dataPin,
|  | uint8_t | clkPin,
|  | uint8_t | csPin,
|  | uint8_t | numDevices = `1`
| ) |  |

Class constructor - arbitrary output pins.

Instantiate a new instance of the class. The parameters passed are used to connect the software to the hardware using the MD_MAX72XX class.

See documentation for the MD_MAX72XX library for detailed explanation of parameters.

Parameters

  mod | the hardware module type used in the application. One of the MD_MAX72XX::moduleType_t values.
  dataPin | output on the Arduino where data gets shifted out.
  clkPin | output for the clock signal.
  csPin | output for selecting the device.
  numDevices | number of devices connected. Default is 1 if not supplied.

## ◆ MD_Parola() [2/2]

MD_Parola::MD_Parola | ( | MD_MAX72XX::moduleType_t | mod,
|  | uint8_t | csPin,
|  | uint8_t | numDevices = `1`
| ) |  |

Class constructor - SPI hardware interface.

Instantiate a new instance of the class. The parameters passed are used to connect the software to the hardware using the MD_MAX72XX class.

See documentation for the MD_MAX72XX library for detailed explanation of parameters.

Parameters

  mod | the hardware module type used in the application. One of the MD_MAX72XX::moduleType_t values.
  csPin | output for selecting the device.
  numDevices | number of devices connected. Default is 1 if not supplied.

## ◆ ~MD_Parola()

MD_Parola::~MD_Parola | ( | void |  | ) |

Class Destructor.

Release allocated memory and does the necessary to clean up once the object is no longer required.

## Member Function Documentation

## ◆ addChar() [1/2]

void MD_Parola::addChar | ( | uint16_t | code,
|  | uint8_t * | data
| ) |  |

Add a user defined character to the replacement list for all zones.

Add a replacement characters to the user defined list. The character data must be the same as for a single character in the font definition file. If a character is specified with a code the same as an existing character the existing data will be substituted for the new data. A character code of 0 ('\0') is illegal as this denotes the end of string character for C++ and cannot be used in an actual string.

The library does not copy the data definition but only retains a pointer to the data, so any changes to the data storage in the calling program will be reflected into the library. The data must also remain in scope while it is being used.

Parameters

  code | code for the character data.
  data | pointer to the character data.

Returns
  No return value.

## ◆ addChar() [2/2]

bool MD_Parola::addChar | ( | uint8_t | z,
|  | uint16_t | code,
|  | uint8_t * | data
| ) |  |

Add a user defined character to the replacement specified zone.

See the comments for the 'all zones' variant of this method

Parameters

  z | zone specified
  code | ASCII code for the character data.
  data | pointer to the character data.

Returns
  true of the character was inserted in the substitution list.

## ◆ begin() [1/2]

void MD_Parola::begin | ( | uint8_t | numZones | ) |

Initialize the object.

Initialize the object data. This needs to be called during setup() to initialize new data for the class that cannot be done during the object creation. This form of the method allows specifying the number of zones used. The module limits for the individual zones are initialized separately using setZone(), which should be done immediately after the invoking begin().

See also
  setZone()

Parameters

  numZones | maximum number of zones

## ◆ begin() [2/2]

void MD_Parola::begin | ( | void |  | ) |

Initialize the object.

Initialize the object data. This needs to be called during setup() to initialize new data for the class that cannot be done during the object creation. This form of the method is for backward compatibility and creates one zone for the entire display.

## ◆ delChar() [1/2]

void MD_Parola::delChar | ( | uint16_t | code | ) |

Delete a user defined character to the replacement list for all zones.

Delete a reference to a replacement character in the user defined list.

Parameters

  code | ASCII code for the character data.

Returns
  No return value.

## ◆ delChar() [2/2]

bool MD_Parola::delChar | ( | uint8_t | z,
|  | uint16_t | code
| ) |  |

Delete a user defined character to the replacement list for the specified zone.

See the comments for the 'all zones' variant of this method.

Parameters

  z | zone specified
  code | ASCII code for the character data.

Returns
  true of the character was found in the substitution list.

## ◆ displayAnimate()

bool MD_Parola::displayAnimate | ( | void |  | ) |

Animate the display.

Animate all the zones in the display using the currently specified text and animation parameters. This method needs to be invoked as often as possible to ensure smooth animation. The animation is governed by a time tick that is set by the setSpeed() or setSpeedInOut() methods and it will pause between entry and exit using the time set by the setPause() method.

The calling program should monitor the return value 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.

Not all calls to this method result in an animation, as this is governed by the timing parameters set for the animation. To determine when an animation has advanced during the call, the user code can call the isAnimationAdvanced() method.

Returns
  bool true if at least one zone animation has completed, false otherwise.

## ◆ displayClear() [1/2]

void MD_Parola::displayClear | ( | uint8_t | z | ) |

Clear one zone in the display.

Clear the specified zone in the current display.

Parameters

  z | specified zone

Returns
  No return value.

## ◆ displayClear() [2/2]

void MD_Parola::displayClear | ( | void |  | ) |

Clear the display.

Clear all the zones in the current display.

Returns
  No return value.

## ◆ displayReset() [1/2]

void MD_Parola::displayReset | ( | uint8_t | z | ) |

Reset the current animation to restart for the specified zone.

See the comments for the 'all zones' variant of this method.

Parameters

  z | specified zone

Returns
  No return value.

## ◆ displayReset() [2/2]

void MD_Parola::displayReset | ( | void |  | ) |

Reset the current animation to restart for all zones.

This method is used to reset all the zone animations an animation back to the start of their cycle current cycle. It is normally invoked after all the parameters for a display are set and the animation needs to be started (or restarted).

Returns
  No return value.

## ◆ displayScroll()

void MD_Parola::displayScroll | ( | const char * | pText,
|  | textPosition_t | align,
|  | textEffect_t | effect,
|  | uint16_t | speed
| ) |  |

Easy start for a scrolling text display.

This method is a convenient way to set up a scrolling display. All the data necessary for setup is passed through as parameters and the display animation is started. Assumes one zone only (zone 0).

Parameters

  pText | parameter suitable for the setTextBuffer() method.
  align | parameter suitable for the the setTextAlignment() method.
  effect | parameter suitable for the the setTextEffect() method.
  speed | parameter suitable for the setSpeed() method.

Returns
  No return value.

## ◆ displayShutdown()

void MD_Parola::displayShutdown | ( | bool | b | ) |

Shutdown or restart display hardware.

Shutdown the display hardware to a low power state. The display will be blank during the shutdown. Calling animate() will continue to animate the display in the memory buffers but this will not be visible on the display (ie, the libraries still function but the display does not).

Parameters

  b | boolean value to shutdown (true) or resume (false).

Returns
  No return value.

## ◆ displaySuspend()

void MD_Parola::displaySuspend | ( | bool | b | ) |

Suspend or resume display updates.

Stop the current display animation. When pausing it leaves the display showing the current text. Resuming will restart the animation where it left off. To reset the animation back to the beginning, use the displayReset() method.

Parameters

  b | boolean value to suspend (true) or resume (false).

Returns
  No return value.

## ◆ displayText()

void MD_Parola::displayText | ( | const char * | pText,
|  | textPosition_t | align,
|  | uint16_t | speed,
|  | uint16_t | pause,
|  | textEffect_t | effectIn,
|  | textEffect_t | effectOut = `PA_NO_EFFECT`
| ) |  |

Easy start for a non-scrolling text display.

This method is a convenient way to set up a static text display. All the data necessary for setup is passed through as parameters and the display animation is started. Assumes one zone only (zone 0).

Parameters

  pText | parameter suitable for the setTextBuffer() method.
  align | parameter suitable for the the setTextAlignment() method.
  speed | parameter suitable for the setSpeed() method.
  pause | parameter suitable for the setPause() method.
  effectIn | parameter suitable for the setTextEffect() method.
  effectOut | parameter suitable for the setTextEffect() method.

Returns
  No return value.

## ◆ displayZoneText()

void MD_Parola::displayZoneText | ( | uint8_t | z,
|  | const char * | pText,
|  | textPosition_t | align,
|  | uint16_t | speed,
|  | uint16_t | pause,
|  | textEffect_t | effectIn,
|  | textEffect_t | effectOut = `PA_NO_EFFECT`
| ) |  |

Easy start for a non-scrolling zone text display.

This method is a convenient way to set up a static text display within the specified zone. All the data necessary for setup is passed through as parameters and the display animation is started.

Parameters

  z | zone specified.
  pText | parameter suitable for the setTextBuffer() method.
  align | parameter suitable for the the setTextAlignment() method.
  speed | parameter suitable for the setSpeed() method.
  pause | parameter suitable for the setPause() method.
  effectIn | parameter suitable for the setTextEffect() method.
  effectOut | parameter suitable for the setTextEffect() method.

Returns
  No return value.

## ◆ getCharSpacing() [1/2]

uint8_t MD_Parola::getCharSpacing | ( | uint8_t | z | ) |

Get the inter-character spacing in columns for a specific zone.

Parameters

  z | zone number.

Returns
  the current setting for the space between characters in columns.

## ◆ getCharSpacing() [2/2]

uint8_t MD_Parola::getCharSpacing | ( | void |  | ) |

Get the inter-character spacing in columns.

Returns
  the current setting for the space between characters in columns. Assumes one zone only.

## ◆ getDisplayExtent() [1/2]

void MD_Parola::getDisplayExtent | ( | uint16_t & | startColumn,
|  | uint16_t & | endColumn
| ) |  |

Get the start and end column numbers for the whole display.

Returns the start and end column numbers for the matrix display. This retains consistency between user code and library.

Parameters

  startColumn | the by-reference parameter that will hold the return value for the start column.
  endColumn | the by-reference parameter that will hold the return value for the end column.

Returns
  The start and end columns in the by-reference parameters.

## ◆ getDisplayExtent() [2/2]

void MD_Parola::getDisplayExtent | ( | uint8_t | z,
|  | uint16_t & | startColumn,
|  | uint16_t & | endColumn
| ) |  |

Get the start and end column numbers for the required zone.

Returns the start and end column numbers for the zone display. This retains consistency between user code and library. The by-reference parameters remain unchanged if an invalid zone number is requested.

Parameters

  z | zone specified
  startColumn | the by-reference parameter that will hold the return value for the start column.
  endColumn | the by-reference parameter that will hold the return value for the end column.

Returns
  The start and end columns in the by-reference parameters.

## ◆ getFont() [1/2]

MD_MAX72XX::fontType_t* MD_Parola::getFont | ( | uint8_t | z | ) |

Get the display font for specified zone.

Get the current font table pointer for the specified zone.

Parameters

  z | specified zone.

Returns
  Pointer to the font definition used.

## ◆ getFont() [2/2]

MD_MAX72XX::fontType_t* MD_Parola::getFont | ( | void |  | ) |

Get the display font for single zone display.

Return the current font table pointer for single zone displays.

Returns
  Pointer to the font definition used.

## ◆ getGraphicObject()

MD_MAX72XX* MD_Parola::getGraphicObject | ( | void |  | ) |

Get a pointer to the instantiated graphics object.

Provides a pointer to the MD_MAX72XX object to allow access to the display graphics functions.

Returns
  Pointer to the MD_MAX72xx object used by the library.

## ◆ getInvert() [1/2]

bool MD_Parola::getInvert | ( | uint8_t | z | ) |

Get the current display invert state for a specific zone.

See the setInvert() method.

Parameters

  z | zone number.

Returns
  the inverted boolean value for the specified zone.

## ◆ getInvert() [2/2]

bool MD_Parola::getInvert | ( | void |  | ) |

Get the current display invert state.

See the setInvert() method.

Returns
  true if the display is inverted. Assumes one zone only.

## ◆ getPause() [1/2]

uint16_t MD_Parola::getPause | ( | uint8_t | z | ) |

Get the current pause time for a specific zone.

See the setPause() method.

Parameters

  z | zone number.

Returns
  the pause value in milliseconds for the specified zone.

## ◆ getPause() [2/2]

uint16_t MD_Parola::getPause | ( | void |  | ) |

Get the current pause time.

See the setPause() method. Assumes one zone only.

Returns
  the pause value in milliseconds.

## ◆ getScrollSpacing()

uint16_t MD_Parola::getScrollSpacing | ( | void |  | ) |

Get the horizontal scrolling spacing.

See the setScrollSpacing() method. Assumes one zone only

Returns
  the speed value.

## ◆ getSpeed() [1/2]

uint16_t MD_Parola::getSpeed | ( | uint8_t | z | ) |

Get the current IN animation speed for the specified zone.

See the setSpeed() method.

Parameters

  z | zone number.

Returns
  the speed value for the specified zone.

## ◆ getSpeed() [2/2]

uint16_t MD_Parola::getSpeed | ( | void |  | ) |

Get the current IN animation speed.

See the setSpeed() method. Assumes one zone only

Returns
  the speed value.

## ◆ getSpeedIn()

uint16_t MD_Parola::getSpeedIn | ( | uint8_t | z | ) |

Get the current IN animation speed for the specified zone.

See the setSpeed() method.

Parameters

  z | zone number.

Returns
  the IN speed value for the specified zone.

## ◆ getSpeedOut()

uint16_t MD_Parola::getSpeedOut | ( | uint8_t | z | ) |

Get the current OUT animation speed for the specified zone.

See the setSpeed() method.

Parameters

  z | zone number.

Returns
  the OUT speed value for the specified zone.

## ◆ getTextAlignment() [1/2]

textPosition_t MD_Parola::getTextAlignment | ( | uint8_t | z | ) |

Get the current text alignment specification for the specified zone.

Parameters

  z | zone number.

Returns
  the current text alignment setting for the specified zone.

## ◆ getTextAlignment() [2/2]

textPosition_t MD_Parola::getTextAlignment | ( | void |  | ) |

Get the current text alignment specification.

Assumes one zone only.

Returns
  the current text alignment setting.

## ◆ getTextColumns() [1/2]

uint16_t MD_Parola::getTextColumns | ( | const char * | p | ) |

Get the text width in columns

Evaluate the width in column for the text string *p as the sum of all the characters and the space between them, using the currently assigned font. Assumes one zone display.

Parameters

  p | nul terminate character string to evaluate.

Returns
  the number of columns used to display the text.

## ◆ getTextColumns() [2/2]

uint16_t MD_Parola::getTextColumns | ( | uint8_t | z,
|  | const char * | p
| ) |  |

Get the text width in columns

Evaluate the width in column for the text string *p in the zone specified, as the sum of all the characters and the space between them. As each zone can
display using a different font table, the result can vary between zones.

Parameters

  z | zone number.
  p | nul terminate character string to evaluate.

Returns
  the number of columns used to display the text.

## ◆ getTextExtent() [1/2]

void MD_Parola::getTextExtent | ( | uint16_t & | startColumn,
|  | uint16_t & | endColumn
| ) |  |

Get the start and end column numbers for the text displayed.

Returns the start and end column numbers for the text displayed in zone 0. This can be used for simplicity when the display is a single zone.

Parameters

  startColumn | the by-reference parameter that will hold the return value for the start column.
  endColumn | the by-reference parameter that will hold the return value for the end column.

Returns
  The start and end columns in the by-reference parameters.

## ◆ getTextExtent() [2/2]

void MD_Parola::getTextExtent | ( | uint8_t | z,
|  | uint16_t & | startColumn,
|  | uint16_t & | endColumn
| ) |  |

Get the start and end column numbers for the text displayed.

Returns the start and end column numbers for the text displayed in the zone. This retains consistency between user code and library.

Parameters

  z | zone specified
  startColumn | the by-reference parameter that will hold the return value for the start column.
  endColumn | the by-reference parameter that will hold the return value for the end column.

Returns
  The start and end columns in the by-reference parameters.

## ◆ getZone()

void MD_Parola::getZone | ( | uint8_t | z,
|  | uint8_t & | moduleStart,
|  | uint8_t & | moduleEnd
| ) |  |

Get the module limits for a zone.

Once a zone has been defined, this method will return the start and end module that were defined for the specified zone.

See also
  setZone()

Parameters

  z | zone number.
  moduleStart | returns the first module number for the zone [0..numZones-1].
  moduleEnd | returns last module number for the zone [0..numZones-1].

## ◆ getZoneEffect()

boolean MD_Parola::getZoneEffect | ( | uint8_t | z,
|  | zoneEffect_t | ze
| ) |  |

Get the value of specified display effect.

The display effect is one of the zoneEffect_t types. The returned value will be true if the attribute is set, false if the attribute is not set.

Parameters

  z | zone number.
  ze | the required text alignment.

Returns
  true if the value is set, false otherwise.

## ◆ getZoneStatus()

bool MD_Parola::getZoneStatus | ( | uint8_t | z | ) |

Get the completion status for a zone.

This method is to determine which zone has completed when displayAnimate() has returned a completion status.

The calling program should monitor the return value for 'true' in order to either reset the zone animation or supply another string for display. A 'true' return value means that the zone has completed its animation cycle.

Parameters

  z | specified zone

Returns
  bool true if the zone animation has completed, false otherwise.

## ◆ isAnimationAdvanced()

bool MD_Parola::isAnimationAdvanced | ( | void |  | ) |

Check if animation frame has advanced.

Check if the last call to animate() resulted in the animation frame advancing by one or more frames in one or more zones. Useful to integrate graphics into the display as they may be affected by the text animation.

For displays with more than one zone, the user code will need to interrogate each zone to determine whether the animation advanced in that zone.

Returns
  True if the animation frame advanced in any of the display zones.

## ◆ setCharSpacing() [1/2]

void MD_Parola::setCharSpacing | ( | uint8_t | cs | ) |

Set the inter-character spacing in columns for all zones.

Set the number of blank columns between characters when they are displayed.

Parameters

  cs | space between characters in columns.

Returns
  No return value.

## ◆ setCharSpacing() [2/2]

void MD_Parola::setCharSpacing | ( | uint8_t | z,
|  | uint8_t | cs
| ) |  |

Set the inter-character spacing in columns for the specified zone.

See comments for the 'all zones' variant of this method.

Parameters

  z | zone number.
  cs | space between characters in columns.

Returns
  No return value.

## ◆ setFont() [1/2]

void MD_Parola::setFont | ( | MD_MAX72XX::fontType_t * | fontDef | ) |

Set the display font for all zones.

Set the display font to a user defined font table. This can be created using the MD_MAX72xx font builder (refer to documentation for the tool and the MD_MAX72xx library). Passing nullptr resets to the library default font.

Parameters

  fontDef | Pointer to the font definition to be used.

Returns
  No return value.

## ◆ setFont() [2/2]

void MD_Parola::setFont | ( | uint8_t | z,
|  | MD_MAX72XX::fontType_t * | fontDef
| ) |  |

Set the display font for a specific zone.

Set the display font to a user defined font table. This can be created using the MD_MAX72xx font builder (refer to documentation for the tool and the MD_MAX72xx library). Passing nullptr resets to the library default font.

Parameters

  z | specified zone.
  fontDef | Pointer to the font definition to be used.

Returns
  No return value.

## ◆ setIntensity() [1/2]

void MD_Parola::setIntensity | ( | uint8_t | intensity | ) |

Set the display brightness for all the zones.

Set the intensity (brightness) of the display.

Parameters

  intensity | the intensity to set the display (0-15).

Returns
  No return value.

## ◆ setIntensity() [2/2]

void MD_Parola::setIntensity | ( | uint8_t | z,
|  | uint8_t | intensity
| ) |  |

Set the display brightness for the specified zone.

See comments for the 'all zones' variant of this method.

Parameters

  z | zone number.
  intensity | the intensity to set the display (0-15).

Returns
  No return value.

## ◆ setInvert() [1/2]

void MD_Parola::setInvert | ( | uint8_t | invert | ) |

Invert the display in all the zones.

Set the display to inverted (ON LED turns OFF and vice versa).

Parameters

  invert | true for inverted display, false for normal display

Returns
  No return value.

## ◆ setInvert() [2/2]

void MD_Parola::setInvert | ( | uint8_t | z,
|  | uint8_t | invert
| ) |  |

Invert the display in the specified zone.

See comments for the 'all zones' variant of this method.

Parameters

  z | zone number.
  invert | true for inverted display, false for normal display

Returns
  No return value.

## ◆ setPause() [1/2]

void MD_Parola::setPause | ( | uint16_t | pause | ) |

Set the pause between ENTER and EXIT animations for all zones.

Between each entry and exit, the library will pause by the number of milliseconds specified to allow the viewer to read the message. For continuous scrolling displays this should be set to the same value as the display speed.

Parameters

  pause | the time, in milliseconds, between animations.

Returns
  No return value.

## ◆ setPause() [2/2]

void MD_Parola::setPause | ( | uint8_t | z,
|  | uint16_t | pause
| ) |  |

Set the pause between ENTER and EXIT animations for the specified zone.

See comments for the 'all zones' variant of this method.

Parameters

  z | zone number.
  pause | the time, in milliseconds, between animations.

Returns
  No return value.

## ◆ setScrollSpacing()

void MD_Parola::setScrollSpacing | ( | uint16_t | space | ) |

Set the horizontal scrolling distance between messages for all the zones.

When scrolling horizontally, the distance between the end of one message and the start of the next can be set using this method. Default behavior is for the message to be fully off the display before the new message starts. Set to zero for default behavior.

Parameters

  space | the spacing, in columns, between messages; zero for default behaviour..

Returns
  No return value.

## ◆ setSpeed() [1/2]

void MD_Parola::setSpeed | ( | uint16_t | speed | ) |

Set identical IN and OUT animation frame speed for all zones.

The speed of the display is the 'tick' time between animation frames. The lower this time the faster the animation; set it to zero to run as fast as possible.

This method sets the IN and OUT animation speeds to be the same.

Parameters

  speed | the time, in milliseconds, between animation frames.

Returns
  No return value.

## ◆ setSpeed() [2/2]

void MD_Parola::setSpeed | ( | uint8_t | z,
|  | uint16_t | speed
| ) |  |

Set the identical IN and OUT animation frame speed for the specified zone.

See comments for the 'all zones' variant of this method.

Parameters

  z | zone number.
  speed | the time, in milliseconds, between animation frames.

Returns
  No return value.

## ◆ setSpeedInOut() [1/2]

void MD_Parola::setSpeedInOut | ( | uint16_t | speedIn,
|  | uint16_t | speedOut
| ) |  |

Set separate IN and OUT animation frame speed for all zones.

The speed of the display is the 'tick' time between animation frames. The lower this time the faster the animation; set it to zero to run as fast as possible.

This method allows the IN and OUT animation speeds to be different.

Parameters

  speedIn | the time, in milliseconds, between IN animation frames.
  speedOut | the time, in milliseconds, between OUT animation frames.

Returns
  No return value.

## ◆ setSpeedInOut() [2/2]

void MD_Parola::setSpeedInOut | ( | uint8_t | z,
|  | uint16_t | speedIn,
|  | uint16_t | speedOut
| ) |  |

Set the separate IN and OUT animation frame speed for the specified zone.

See comments for the 'all zones' variant of this method.

Parameters

  z | zone number.
  speedIn | the time, in milliseconds, between IN animation frames.
  speedOut | the time, in milliseconds, between OUT animation frames.

Returns
  No return value.

## ◆ setSpriteData() [1/2]

void MD_Parola::setSpriteData | ( | const uint8_t * | inData,
|  | uint8_t | inWidth,
|  | uint8_t | inFrames,
|  | const uint8_t * | outData,
|  | uint8_t | outWidth,
|  | uint8_t | outFrames
| ) |  |

Set data for user sprite effect (whole display).

See the comments for single zone variant of this method.

Parameters

  inData | pointer to the data table defining the entry sprite.
  inWidth | the width (in bytes) of each frame of the sprite.
  inFrames | the number of frames for the sprite.
  outData | pointer to the data table that is inWidth*InFrames in size.
  outWidth | the width (in bytes) of each frame of the sprite.
  outFrames | the number of frames for the sprite.

Returns
  No return value.

## ◆ setSpriteData() [2/2]

void MD_Parola::setSpriteData | ( | uint8_t | z,
|  | const uint8_t * | inData,
|  | uint8_t | inWidth,
|  | uint8_t | inFrames,
|  | const uint8_t * | outData,
|  | uint8_t | outWidth,
|  | uint8_t | outFrames
| ) |  |

Set data for user sprite effects (single zone).

This method is used to set up user data needed so that the library can display the sprite ahead of the entry/exit of text when the PA_SPRITE animation type is selected.

A sprite is made up of a number of frames that run sequentially to make make the animation on the display. Once the animation reaches the last frame it restarts from the first frame.

A sprite is defined similarly to a character in the font table. Each byte is a bit pattern defining a column in the sprite. A frame is xWidth bytes in size and there are xFrames in the animation.

Parameters

  z | zone number.
  inData | pointer to the data table defining the entry sprite.
  inWidth | the width (in bytes) of each frame of the sprite.
  inFrames | the number of frames for the sprite.
  outData | pointer to the data table that is inWidth*InFrames in size.
  outWidth | the width (in bytes) of each frame of the sprite.
  outFrames | the number of frames for the sprite.

Returns
  No return value.

## ◆ setTextAlignment() [1/2]

void MD_Parola::setTextAlignment | ( | textPosition_t | ta | ) |

Set the text alignment for all zones.

Text alignment is specified as one of the values in textPosition_t.

Parameters

  ta | the required text alignment.

Returns
  No return value.

## ◆ setTextAlignment() [2/2]

void MD_Parola::setTextAlignment | ( | uint8_t | z,
|  | textPosition_t | ta
| ) |  |

Set the text alignment for the specified zone.

See comments for the 'all zones' variant of this method.

Parameters

  z | zone number.
  ta | the required text alignment.

Returns
  No return value.

## ◆ setTextBuffer() [1/2]

void MD_Parola::setTextBuffer | ( | const char * | pb | ) |

Set the pointer to the text buffer.

Sets the text buffer to be a pointer to user data. The library does not allocate any memory for the text message, rather it is the calling program that supplies a pointer to a buffer. This reduces memory requirements and offers the flexibility to keep a single buffer or rotate buffers with different messages, all under calling program control, with no library limit to the size or numbers of buffers. The text placed in the buffer must be properly terminated by the NUL ('\0') character or processing will overrun the end of the message.

This form of the method assumes one zone only.

Parameters

  pb | pointer to the text buffer to be used.

Returns
  No return value.

## ◆ setTextBuffer() [2/2]

void MD_Parola::setTextBuffer | ( | uint8_t | z,
|  | const char * | pb
| ) |  |

Set the pointer to the text buffer for the specified zone.

See comments for the single zone version of this method.

Parameters

  z | zone number.
  pb | pointer to the text buffer to be used.

Returns
  No return value.

## ◆ setTextEffect() [1/2]

void MD_Parola::setTextEffect | ( | textEffect_t | effectIn,
|  | textEffect_t | effectOut
| ) |  |

Set the entry and exit text effects for all zones.

The 'in' and 'out' text effects are specified using the textEffect_t enumerated type. If no effect is required, NO_EFFECT should be specified. NO_EFFECT is most useful when no exit effect is required (e.g., when DISSOLVE is used) and the entry effect is sufficient.

Parameters

  effectIn | the entry effect, one of the textEffect_t enumerated values.
  effectOut | the exit effect, one of the textEffect_t enumerated values.

Returns
  No return value.

## ◆ setTextEffect() [2/2]

void MD_Parola::setTextEffect | ( | uint8_t | z,
|  | textEffect_t | effectIn,
|  | textEffect_t | effectOut
| ) |  |

Set the entry and exit text effects for a specific zone.

See comments for the 'all zones' variant of this method.

Parameters

  z | zone number.
  effectIn | the entry effect, one of the textEffect_t enumerated values.
  effectOut | the exit effect, one of the textEffect_t enumerated values.

Returns
  No return value.

## ◆ setZone()

bool MD_Parola::setZone | ( | uint8_t | z,
|  | uint8_t | moduleStart,
|  | uint8_t | moduleEnd
| ) |  |

Define the module limits for a zone.

When multiple zones are defined, the library needs to know the contiguous module ranges that make up the different zones. If the library has been started with only one zone then it will automatically initialize the zone to be the entire range for the display modules, so calling this function is not required. However, when multiple zones are defined, setZone() for each zone should be should be invoked immediately after the call to begin().

A module is a unit of 8x8 LEDs, as defined in the MD_MAX72xx library. Zones should not overlap or unexpected results will occur.

See also
  begin()

Parameters

  z | zone number.
  moduleStart | the first module number for the zone [0..numZones-1].
  moduleEnd | the last module number for the zone [0..numZones-1].

Returns
  true if set, false otherwise.

## ◆ setZoneEffect()

void MD_Parola::setZoneEffect | ( | uint8_t | z,
|  | boolean | b,
|  | zoneEffect_t | ze
| ) |  |

Set the display effect for the specified zone.

The display effect is one of the zoneEffect_t types, and this will be set (true) or reset (false) depending on the boolean value. The resulting zone display will be modified as per the required effect.

Parameters

  z | zone number.
  b | set the value if true, reset the value if false
  ze | the required text alignment.

Returns
  No return value.

## ◆ synchZoneStart()

void MD_Parola::synchZoneStart | ( | void |  | ) |

Synchronize the start of zone animations.

When zones are set up, the animation start time will default to the set-up time. If several zones need to be animated in synchronized fashion (eg, they are visually stacked vertically), this method will ensure that all the zones start at the same instant. The method should be invoked before the call to displayAnimate().

Returns
  No return value.

## ◆ write() [1/3]

size_t MD_Parola::write | ( | const char * | str | ) |
| virtual

Write a nul terminated string to the output display.

Display a nul terminated string when given a pointer to the char array. Invokes an animation using PA_PRINT with all other settings (alignment, speed, etc) taken from current defaults. This method also invokes the animation for the print and returns when that has finished, so it blocks while the printing is happening, which should be at least one iteration of the wait loop.

Parameters

  str | Pointer to the nul terminated char array.

Returns
  the number of characters written.

## ◆ write() [2/3]

size_t MD_Parola::write | ( | const uint8_t * | buffer,
|  | size_t | size
| ) |  |
| virtual

Write a character buffer to the output display.

Display a non-nul terminated string given a pointer to the buffer and the size of the buffer. The buffer is turned into a nul terminated string and the simple write() method is invoked. Memory is allocated and freed in this method to copy the string.

Parameters

  buffer | Pointer to the data buffer.
  size | The number of bytes to write.

Returns
  the number of bytes written.

## ◆ write() [3/3]

virtual size_t MD_Parola::write | ( | uint8_t | c | ) |
| virtual

Write a single character to the output display

Display a character when given the ASCII code for it. The character is converted to a string and the string printing function invoked. The LED display is designed for string based output, so it does not make much sense to do this. Creating the short string is a consistent way to way to handle single the character.

Parameters

  c | ASCII code for the character to write.

Returns
  the number of characters written.

The documentation for this class was generated from the following files:

- src/MD_Parola.h
- src/MD_Parola.cpp