ESPectro32 Library
Library for using ESPectro32 board
|
Base class of Led Matrix animation. More...
#include <ESPectro32_LedMatrix_Animation.h>
Public Types | |
typedef std::function< void(ESPectro32_LedMatrix &ledMatrix)> | FrameDataCallback |
Public Member Functions | |
void | setLedMatrix (ESPectro32_LedMatrix &ledM) |
ESPectro32_LedMatrix & | LedMatrix () |
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 | |
Animator * | getAnimatorPtr () |
Protected Attributes | |
ESPectro32_LedMatrix * | ledMatrix_ = NULL |
uint8_t | frameCount_ = 0 |
bool | forceStop_ = false |
Animator::AnimationFinishedCallback | animCompletedCb_ = NULL |
Animator * | animator_ = NULL |
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.