ESPectro32 Library
Library for using ESPectro32 board
|
The LED animator. More...
#include <ESPectro32_LED.h>
Public Member Functions | |
void | initPWM (byte pin, bool activeHigh=false) |
void | setAnimation (ESPectro32_LED_AnimationType animType, uint32_t speed) |
bool | runAnimation () |
void | setBrightness (RgbLedColor_t maxOut) |
void | setRefreshRate (int refreshRate) |
void | runAsync (void *data) |
Body of the task to execute. More... | |
void | start () |
void | stop () |
void | setTimeout (unsigned long timeOut) |
bool | isAnimating () |
Public Member Functions inherited from Task | |
Task (std::string taskName="Task", uint16_t stackSize=2048, UBaseType_t priority=5) | |
Task (BaseType_t coreId, std::string taskName="Task", uint16_t stackSize=2048, UBaseType_t priority=5) | |
void | setStackSize (uint16_t stackSize) |
void | setPriority (UBaseType_t priority) |
void | setTaskName (std::string &taskN) |
void | start (void *taskData=nullptr) |
Start an instance of the task. More... | |
void | stop () |
void | delay (int ms) |
Suspend the task for the specified milliseconds. More... | |
Private Attributes | |
ESPectro32_LED_AnimationType | animationType_ = ESPectro_LED_Animation_OFF |
bool | activeHigh_ |
uint32_t | speed_ |
uint32_t | refreshMillis_ |
uint32_t | refreshRate_ |
unsigned long | animStartTime_ |
unsigned long | lastRefreshTime_ |
unsigned long | animTimeOut_ = 30000 |
bool | animating_ = false |
byte * | pins_ = NULL |
byte | numLeds_ = 1 |
byte | numPins_ = 1 |
RgbLedColor_t | maxOut_ |
RgbLedColor_t * | ledColors_ |
RgbLedPalette_t | palette_ |
void(ESPectro32_LED_Animator::* | animFunc_ )() |
The LED animator.
|
virtual |
Body of the task to execute.
This function must be implemented in the subclass that represents the actual task to run. When a task is started by calling start(), this is the code that is executed in the newly created task.
[in] | data | The data passed in to the newly started task. |
Implements Task.
void ESPectro32_LED_Animator::setRefreshRate | ( | int | refreshRate | ) |
Sets the maximum refresh rate in Hz (default value is 50 Hz). May be useful to reduce flickering in some cases.