|
| AccessoryLightMulti () |
|
void | begin (unsigned long inId, uint8_t inSize, unsigned long inBlinkDuration) |
|
void | beginLight (uint8_t inIndex, Port *inpPort, int inIntensity = 255) |
|
bool | IsOn (uint8_t inIndex) const |
|
bool | IsBlinking (uint8_t inIndex) const |
|
bool | IsFading (uint8_t inIndex) const |
|
uint8_t | GetSize () const |
|
unsigned char | AddMovingPosition (unsigned long inId, int inOnMask, int inBlinkMask = 0) |
|
void | AdjustMovingPositionBlinksSize (uint8_t inNewSize) |
|
int | GetMovingPositionBlinksByIndex (int inIndex) const |
|
void | SetBlinking (uint8_t inIndex, unsigned long inBlinkingDelay) |
|
void | SetFading (uint8_t inIndex, uint8_t inStep, uint8_t inDelay) |
|
void | Event (unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0) |
|
void | LightOn (uint8_t inIndex) |
|
void | LightOff (uint8_t inIndex) |
|
void | Blink (uint8_t inIndex) |
|
void | LightOn () |
|
void | LightOff () |
|
void | Blink () |
|
| Accessory () |
|
void | begin (ACC_STATE inStartingState = STATE_NONE) |
|
Port * | GetPort () const |
|
ACC_STATE | GetState () const |
|
ACC_STATE | GetPreviousState () const |
|
bool | IsNone () const |
|
bool | IsFirst () const |
|
bool | IsSecond () const |
|
unsigned int | GetDebounceDelay () const |
|
unsigned long | GetLastMoveTime () const |
|
unsigned long | GetDuration () const |
|
bool | loop () |
|
uint8_t | AddMovingPosition (unsigned long inId, int inPosition) |
|
uint8_t | AddMovingPositions (const MovingPosition *inMovingPositions_P) |
|
void | AdjustMovingPositionsSize (uint8_t inNewSize) |
|
bool | IsEmpty () const |
|
uint8_t | IndexOfMovingPositionById (unsigned long inId) const |
|
int | GetMovingPositionValueById (unsigned long inId) const |
|
int | GetMovingPositionValueByIndex (uint8_t inIndex) const |
|
unsigned long | GetMovingPositionIdByIndex (uint8_t inIndex) const |
|
const uint8_t | GetLastMovingPosition () const |
|
const uint8_t | GetMovingPositionSize () const |
|
void | SetLastMovingPosition (uint8_t inLastPositionIndex) |
|
void | SetDebounceDelay (unsigned int inDebounceDelay) |
|
void | SetLastMoveTime () |
|
void | SetDuration (unsigned long inDuration) |
|
void | SetNextAccessory (Accessory *inAccessory) |
|
Accessory * | GetNextAccessory () const |
|
unsigned long | GetActionStartingMillis () const |
|
virtual void | StartAction () |
|
virtual void | StartAction (ACC_STATE inState) |
|
virtual void | ResetAction () |
|
bool | IsActionDelayPending () const |
|
virtual bool | IsGroupActionPending () const |
|
virtual bool | CanBePositional () const |
|
virtual void | MovePosition (int inPosition) |
|
virtual void | SetState (ACC_STATE inNewState) |
|
void | SetStateRaw (ACC_STATE inNewState) |
|
void | SetStartingMillis () |
|
void | ResetStartingMillis () |
|
This class describes a group of lights. This is typically used for railroad or traffic signals. This group of lights can define a 'MovingPosition' which represents a combination of lights on, off and/or blinking. Each moving position defines an identifier and two masks on an integer, one for on/off status, another optional one for blinking lights. An integer is 16 bits long, so this is the maximum number of lights a MovingPosition can handle.
For a group of five lights, three moving positions defined with id from 125 to 127 (why not ?) :
moving position id | mask | blink mask | light 0 | 1 | 2 | 3 | 4 |
125 | B10000 | B00000 | on | off | off | off | off |
126 | B10100 | B00000 | on | off | on | off | off |
127 | B11000 | B00001 | on | on | off | off | blink |
The moving positions are stored like any other Accessory in the MovingPosition list in the base class Accessory itself. The blinking masks cannot be stored in the same structure, so a new list of blinking masks is created inside this class, and the indexes are synchronized between the two lists.
Events handled:
id | type | data | effect |
moving position id | ACCESSORIES_EVENT_MOVEPOSITIONID | | Use the id to reach this moving position |
moving position id | ACCESSORIES_EVENT_MOVEPOSITIONINDEX | Index | Use the index to reach this moving position |
light id | ACCESSORIES_EVENT_TOGGLE | | toggle all lights on/off |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_STRAIGHT | All Lights On |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_TOP | All Lights On |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_LEFT | All Lights On |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_DIVERGE | All Lights On |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_BOTTOM | All Lights On |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_RIGHT | All Lights On |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_ON | All Lights On |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_STOP | All Lights Off |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_OFF | All Lights Off |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_MORE | Increase speed of 1 for all ligths |
light id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_LESS | Decrease speed of 1 for all lights |
light id | ACCESSORIES_EVENT_MOVEPOSITION | New speed | Set the all the lights On at the given speed, without changing the current speed. |
light id | ACCESSORIES_EVENT_SETSPEED | New speed | Change the current speed for all lights |
Definition at line 57 of file AccessoryLightMulti.hpp.