ESPectro32 Library
Library for using ESPectro32 board
 All Classes Functions Variables Enumerations Enumerator Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ESPectro32_LedMatrix_Animation Class Reference

Base class of Led Matrix animation. More...

#include <ESPectro32_LedMatrix_Animation.h>

Inheritance diagram for ESPectro32_LedMatrix_Animation:
ESPectro32_LedMatrix_ScrollTextAnimation

Public Types

typedef std::function< void(ESPectro32_LedMatrix
&ledMatrix)> 
FrameDataCallback
 

Public Member Functions

void setLedMatrix (ESPectro32_LedMatrix &ledM)
 
ESPectro32_LedMatrixLedMatrix ()
 
void onAnimationCompleted (Animator::AnimationFinishedCallback cb)
 
void addFrameWithData (uint8_t *data, uint16_t color=255)
 
void addFrameWithDataCallback (ESPectro32_LedMatrix_Animation::FrameDataCallback cb)
 
void setFrameWithData (uint8_t frameNo, uint8_t *data, uint16_t color=255)
 
void setFrameWithDataCallback (uint8_t frameNo, ESPectro32_LedMatrix_Animation::FrameDataCallback cb)
 
void start (Animator::AnimationUpdateCallback animUpdateCallback, Animator::AnimationFinishedCallback animFinishedCallback, uint16_t duration=0, uint16_t updateInterval=0)
 
void start (uint16_t duration=0, bool repeat=false)
 
void stop ()
 
void run ()
 

Protected Member Functions

AnimatorgetAnimatorPtr ()
 

Protected Attributes

ESPectro32_LedMatrixledMatrix_ = NULL
 
uint8_t frameCount_ = 0
 
bool forceStop_ = false
 
Animator::AnimationFinishedCallback animCompletedCb_ = NULL
 
Animatoranimator_ = NULL
 

Detailed Description

Base class of Led Matrix animation.

You should call setLedMatrix to set Led Matrix object before doing anything. Then call either addFrameWithData to set frame data, or addFrameWithCallback to provide a callback that set frame. Then call start with duration (in milisecond) to actually start the animation.

This class leverage the animation capability of on-board IS31FL3731 chip (that drives the Led Matrix). It supports up to 8 frames. The good thing of using this chip is that you never actually store frame data in RAM, as frame data is directly written to the chip.

Examples:
examples-idf/ex_leds_anim.hpp, examples-idf/ex_wifi_conn_anim.hpp, examples/LEDMatrix/LEDMatrix.ino, and examples/Neopixel/Neopixel.ino.

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