#include "AccessoryBaseLight.hpp"
Public Member Functions | |
AccessoryBaseLight (Accessory *inpOwner = 0) | |
void | begin (Port *inpPort, int inIntensity = 255, Accessory *inpOwner = 0) |
Port * | GetPort () const |
bool | IsOn () const |
bool | IsBlinking () const |
bool | IsFading () const |
void | Event (ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0) |
void | SetBlinking (unsigned long inBlinkingDelay) |
void | SetFading (uint8_t inStep, uint8_t inDelay) |
Friends | |
class | AccessoryLight |
class | AccessoryLightMulti |
This class describes a proxy for a basic light. This is the way to share identical functions and behaviors for many kind of light accessory. A light basically can be on, off, blinking and / or fading (dim light).
Definition at line 26 of file AccessoryBaseLight.hpp.
AccessoryBaseLight::AccessoryBaseLight | ( | Accessory * | inpOwner = 0 | ) |
Default constructor.
Definition at line 15 of file AccessoryBaseLight.cpp.
Initialize the instance.
inpPort | Port driven this light. |
inIntensity | Intensity of this light. Default is maximum, 255. |
inpOwner | Address of the real Accessory owner of this proxy. |
Definition at line 62 of file AccessoryBaseLight.cpp.
void AccessoryBaseLight::Event | ( | ACCESSORIES_EVENT_TYPE | inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID , |
int | inData = 0 |
||
) |
Execute a new event.
inEvent | Type of the new event. Default is ACCESSORIES_EVENT_MOVEPOSITIONID. |
inData | Associated data to the event type. Default is 0. |
Definition at line 120 of file AccessoryBaseLight.cpp.
|
inline |
Gets the associated port.
Definition at line 61 of file AccessoryBaseLight.hpp.
|
inline |
Checks if the light is blinking.
Definition at line 69 of file AccessoryBaseLight.hpp.
|
inline |
Checks if the light is fading.
Definition at line 74 of file AccessoryBaseLight.hpp.
|
inline |
Checks if the light is on.
Definition at line 65 of file AccessoryBaseLight.hpp.
|
inline |
Set the blinking mode, with a duration for a blink.
inBlinkingDelay | Duration of the light on state. The same duration is applied for light off. |
Definition at line 84 of file AccessoryBaseLight.hpp.
void AccessoryBaseLight::SetFading | ( | uint8_t | inStep, |
uint8_t | inDelay | ||
) |
Set the fading mode, defining its speed.
inStep | Number of steps between light on and light off. |
inDelay | Duration of each step. |
Definition at line 48 of file AccessoryBaseLight.cpp.