FastLED 3.9.15
|
Tools for tracking and working with time.
Classes | |
class | CEveryNMillisDynamic |
Create the CEveryNMillisDynamic class for dynamic millisecond intervals. More... | |
class | CEveryNMillisRandom |
class | CEveryNTime |
Time interval checking class. More... | |
Macros | |
#define | GET_MILLIS millis |
The a number of functions need access to a millisecond counter in order to keep time. | |
#define | INSTANTIATE_EVERY_N_TIME_PERIODS(NAME, TIMETYPE, TIMEGETTER) |
Preprocessor-based class "template" for CEveryNTime, used with EVERY_N_TIME timekeepers. | |
#define | USE_GET_MILLISECOND_TIMER |
Set this flag to use the get_millisecond_timer() function in place of the default millis() function. | |
Functions | |
LIB8STATIC uint16_t | bseconds16 () |
Returns the current time-since-boot in "binary seconds", which are actually 1024/1000 of a second long. | |
LIB8STATIC uint16_t | div1024_32_16 (uint32_t in32) |
Helper routine to divide a 32-bit value by 1024, returning only the low 16 bits. | |
LIB8STATIC uint8_t | hours8 () |
Return the current hours since boot in an 8-bit value. | |
LIB8STATIC uint16_t | minutes16 () |
Return the current minutes since boot in a 16-bit value. | |
LIB8STATIC uint16_t | seconds16 () |
Return the current seconds since boot in a 16-bit value. | |
CEveryNTime Base Classes | |
These macros define the time interval checking classes used in the | |
INSTANTIATE_EVERY_N_TIME_PERIODS (CEveryNMillis, uint32_t, GET_MILLIS) | |
Create the CEveryNMillis class for millisecond intervals. | |
INSTANTIATE_EVERY_N_TIME_PERIODS (CEveryNSeconds, uint16_t, seconds16) | |
Create the CEveryNSeconds class for second intervals. | |
INSTANTIATE_EVERY_N_TIME_PERIODS (CEveryNBSeconds, uint16_t, bseconds16) | |
Create the CEveryNBSeconds class for bsecond intervals. | |
INSTANTIATE_EVERY_N_TIME_PERIODS (CEveryNMinutes, uint16_t, minutes16) | |
Create the CEveryNMinutes class for minutes intervals. | |
INSTANTIATE_EVERY_N_TIME_PERIODS (CEveryNHours, uint8_t, hours8) | |
Create the CEveryNHours class for hours intervals. | |
#define | CEveryNMilliseconds CEveryNMillis |
Alias for CEveryNMillis. | |
"EVERY_N_TIME" Macros | |
Check whether to excecute a block of code every N amount of time. These are useful for limiting how often code runs. For example, you can use fill_rainbow() to fill a strip of LEDs with color, combined with an EVERY_N_MILLIS block to limit how fast the colors change: static uint8_t hue = 0;
EVERY_N_MILLIS(20) { hue++; } // advances hue every 20 milliseconds
void fill_rainbow(struct CRGB *targetArray, int numToFill, uint8_t initialhue, uint8_t deltahue) Fill a range of LEDs with a rainbow of colors. Definition colorutils.cpp:75 #define EVERY_N_MILLIS(N) Checks whether to execute a block of code every N milliseconds. Definition lib8tion.h:1315 Note that in order for these to be accurate, the EVERY_N block must be evaluated at a regular basis. | |
#define | EVERY_N_MILLIS(N) |
Checks whether to execute a block of code every N milliseconds. | |
#define | EVERY_N_MILLIS_I(NAME, N) |
Checks whether to execute a block of code every N milliseconds, using a custom instance name. | |
#define | EVERY_N_SECONDS(N) |
Checks whether to execute a block of code every N seconds. | |
#define | EVERY_N_SECONDS_I(NAME, N) |
Checks whether to execute a block of code every N seconds, using a custom instance name. | |
#define | EVERY_N_BSECONDS(N) |
Checks whether to execute a block of code every N bseconds. | |
#define | EVERY_N_BSECONDS_I(NAME, N) |
Checks whether to execute a block of code every N bseconds, using a custom instance name. | |
#define | EVERY_N_MINUTES(N) |
Checks whether to execute a block of code every N minutes. | |
#define | EVERY_N_MINUTES_I(NAME, N) |
Checks whether to execute a block of code every N minutes, using a custom instance name. | |
#define | EVERY_N_HOURS(N) |
Checks whether to execute a block of code every N hours. | |
#define | EVERY_N_HOURS_I(NAME, N) |
Checks whether to execute a block of code every N hours, using a custom instance name. | |
#define | EVERY_N_MILLISECONDS(N) |
Alias for EVERY_N_MILLIS. | |
#define | EVERY_N_MILLISECONDS_I(NAME, N) |
Alias for EVERY_N_MILLIS_I. | |
#define | EVERY_N_MILLISECONDS_DYNAMIC(PERIOD_FUNC) |
Checks whether to execute a block of code every N milliseconds, where N is determined dynamically. | |
#define | EVERY_N_MILLISECONDS_DYNAMIC_I(NAME, PERIOD_FUNC) |
Checks whether to execute a block of code every N milliseconds, where N is determined dynamically, using a custom instance name. | |
#define | EVERY_N_MILLISECONDS_RANDOM(MIN, MAX) |
#define | EVERY_N_MILLISECONDS_RANDOM_I(NAME, MIN, MAX) |