| Parola for Arduino 1.0 Text effects for Parola modular hardware

- Main Page
- Related Pages
- Classes

- Class List
- Class Index
- Class Members

All Classes Functions Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
MD_Parola Class Reference

`#include <MD_Parola.h>`

## Public Types
enum | textPosition_t { LEFT, CENTER, RIGHT }
enum | textEffect_t { NO_EFFECT, PRINT, SLICE, WIPE, WIPE_CURSOR, OPENING, OPENING_CURSOR, CLOSING, CLOSING_CURSOR, BLINDS, DISSOLVE, SCROLL_UP, SCROLL_DOWN, SCROLL_LEFT, SCROLL_RIGHT }

## Public Member Functions
| MD_Parola (uint8_t dataPin, uint8_t clkPin, uint8_t csPin, uint8_t numDevices=1)
void | begin (void)
| ~MD_Parola (void)
Methods for core object control.
bool | displayAnimate (void)
void | displayClear (void)
void | displayReset (void)
void | displayScroll (char *pText, textPosition_t align, textEffect_t effect, uint16_t speed)
void | displaySuspend (bool b)
void | displayText (char *pText, textPosition_t align, uint16_t speed, uint16_t pause, textEffect_t effectIn, textEffect_t effectOut=NO_EFFECT)
Support methods for visually adjusting the display.
uint8_t | getCharSpacing (void)
bool | getInvert (void)
uint16_t | getPause (void)
uint16_t | getSpeed (void)
textPosition_t | getTextAlignment (void)
void | setCharSpacing (uint8_t cs)
void | setIntensity (uint8_t intensity)
void | setInvert (uint8_t invert)
void | setPause (uint16_t pause)
void | setSpeed (uint16_t speed)
void | setTextAlignment (textPosition_t ta)
void | setTextBuffer (char *pb)
void | setTextEffect (textEffect_t effectIn, textEffect_t effectOut)

## Detailed Description

Core object for the Parola library

## Member Enumeration Documentation

enum MD_Parola::textEffect_t

Special effect specification.

Used to define the effects to be used for the entry and exit of text in the display area.

Enumerator
NO_EFFECT | Used as a place filler, executes no operation.
PRINT | Text just appears (printed)
SLICE | Text enters and exits a slice (column) at a time.
WIPE | Text appears/disappears one column at a time, looks like it is wiped on and off.
WIPE_CURSOR | WIPE with a light bar ahead of the change.
OPENING | Appear and disappear from the center of the display, towards the ends.
OPENING_CURSOR | OPENING with light bars ahead of the change.
CLOSING | Appear and disappear from the ends of the display, tords the middle.
CLOSING_CURSOR | CLOSING with light bars ahead of the change.
BLINDS | Text is replaced behind vertical blinds.
DISSOLVE | Text dissolves from one display to another.
SCROLL_UP | Text scrolls up through the display.
SCROLL_DOWN | Text scrolls down through the display.
SCROLL_LEFT | Text scrolls right to left on the display.
SCROLL_RIGHT | Text scrolls left to right on the display.

enum MD_Parola::textPosition_t

Text alignment specification.

Used to define the display text aligmnent and to specify direction for scrolling and animations. In the situation where LEFT AND RIGHT are the onty sensible options (eg, text scrolling direction), CENTER will behave the same as LEFT.

Enumerator
LEFT | The leftmost column for the first character will be on the left side of the display.
CENTER | The text will be placed with equal number of blank display columns either side.
RIGHT | The rightmost column of the last character will be on the right side of the display.

## Constructor & Destructor Documentation

MD_Parola::MD_Parola | ( | 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

  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::~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

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

Initialise the object.

Initialise the object data. This needs to be called during setup() to initialise new data for the class that cannot be done during the object creation.

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

Animate the display.

Animate the display using the currently specifed text and animation parameters. This method needs to be invoked as often as possible to ensure smooth animation. The animation is goverened by a time tick that is set by the setSpeed() method 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 animation or supply another string for display.

Returns
  bool true if the current animation has competed, false otherwise.

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

Clear the display.

Clear all the data from the current display.

Returns
  No return value.

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

Reset the current animation to restart.

This method is used to reset an animation back to the start of the 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.

void MD_Parola::displayScroll | ( | 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.

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.

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

Suspend or resume display updates.

Stop the current animation at the point it is at. 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.

void MD_Parola::displayText | ( | char * | pText,
|  | textPosition_t | align,
|  | uint16_t | speed,
|  | uint16_t | pause,
|  | textEffect_t | effectIn,
|  | textEffect_t | effectOut = `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.

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.

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

Get the inter-character spacing in columns.

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

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

Get the current display invert state.

See the setInvert() method.

Returns
  the inverted boolean value.

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

Get the current pause time.

See the setPause() method.

Returns
  the pause value in milliseconds.

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

Get the current animation speed.

See the setSpeed() method

Returns
  the speed value.

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

Get the current text alignment specification.

Returns
  the current text alignment setting.

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

Set the inter-character spacing in columns.

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

Parameters

  cs | space between characters in columns.

Returns
  No return value.

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

Set the display brightness.

Set the intensity (brightness) of the display.

Parameters

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

Returns
  No return value.

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

Invert the display.

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.

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

Set the pause between ENTER and EXIT animations.

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.

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

Set the animation frame speed.

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.

Parameters

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

Returns
  No return value.

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

Set the text alignment.

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

Parameters

  ta | the required text alignment.

Returns
  No return value.

void MD_Parola::setTextBuffer | ( | 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 livbrary 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.

Parameters

  pb | pointer to the text buffer to be used.

Returns
  No return value.

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

Set the entry and exit text effects.

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.

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

- MD_Parola.h
- MD_Parola.cpp
- MD_Parola_Blinds.cpp
- MD_Parola_Close.cpp
- MD_Parola_Dissolve.cpp
- MD_Parola_HScroll.cpp
- MD_Parola_Open.cpp
- MD_Parola_Print.cpp
- MD_Parola_Slice.cpp
- MD_Parola_VScroll.cpp
- MD_Parola_Wipe.cpp