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

The LED animator. More...

#include <ESPectro32_LED.h>

Inheritance diagram for ESPectro32_LED_Animator:
Task

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 Member Functions

void setAnimationFunc (ESPectro32_LED_AnimationType animType)
 
int getStep (long t0, long t, int v)
 
float getStepFloat (long t0, long t, float v)
 
void on ()
 
void off ()
 
void blink ()
 
void fade ()
 
void strobo ()
 

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_tledColors_
 
RgbLedPalette_t palette_
 
void(ESPectro32_LED_Animator::* animFunc_ )()
 

Detailed Description

The LED animator.

Member Function Documentation

void ESPectro32_LED_Animator::runAsync ( void *  data)
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.

Parameters
[in]dataThe 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.


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