11 #if defined(ARDUINO) && ARDUINO >= 100 22 #ifndef FADE_LED_MAX_LED 23 #define FADE_LED_MAX_LED 6 33 #ifndef FADE_LED_RESOLUTION 34 #define FADE_LED_RESOLUTION 255 162 void setTime(
unsigned long time,
bool constTime =
false);
bool falling()
Returns if the led is still fading down.
Definition: FadeLed.cpp:67
void updateThis()
Updates fading of this object only.
Definition: FadeLed.cpp:71
Main class of the FadeLed-library.
Definition: FadeLed.h:44
FadeLed(byte pin)
Constructor of a FadeLed object.
Definition: FadeLed.cpp:9
void on()
Fade to max brightness.
Definition: FadeLed.cpp:45
byte _startVal
The brightness at which the new fade needs to start.
Definition: FadeLed.h:224
unsigned long _count
The number of _interval's passed.
Definition: FadeLed.h:228
static void setInterval(unsigned int interval)
Sets the interval at which to update the fading.
Definition: FadeLed.cpp:141
byte _setVal
The brightness to which last set to fade to.
Definition: FadeLed.h:223
#define FADE_LED_MAX_LED
Maximum number of FadeLed objects.
Definition: FadeLed.h:23
void off()
Fade to off.
Definition: FadeLed.cpp:49
void setTime(unsigned long time, bool constTime=false)
Set the time a (full) fade will take.
Definition: FadeLed.cpp:57
static unsigned int _interval
Interval (in ms) between updates.
Definition: FadeLed.h:243
static FadeLed * _ledList[FADE_LED_MAX_LED]
array of pointers to all FadeLed objects
Definition: FadeLed.h:241
void begin(byte val)
Set a direct begin value to start at without fade.
Definition: FadeLed.cpp:20
static unsigned int _millisLast
Last time all FadeLed objects where updated.
Definition: FadeLed.h:244
byte _pin
PWM pin to control.
Definition: FadeLed.h:222
bool _constTime
Constant time fade or just constant speed fade.
Definition: FadeLed.h:226
unsigned long _countMax
The number of _interval's a fade should take.
Definition: FadeLed.h:227
static byte _ledCount
Next number of FadeLed object.
Definition: FadeLed.h:242
bool done()
Returns if the led is done fading.
Definition: FadeLed.cpp:41
bool rising()
Returns if the led is still fading up.
Definition: FadeLed.cpp:63
static void update()
Updates all FadeLed objects.
Definition: FadeLed.cpp:145
void beginOn()
Sets the start brightness directly to full.
Definition: FadeLed.cpp:53
byte _curVal
Current brightness.
Definition: FadeLed.h:225