Accessories
Arduino for motors and lights library.
AccessoryLight.hpp
1 //-------------------------------------------------------------------
2 #ifndef __accessoryLight_H__
3 #define __accessoryLight_H__
4 //-------------------------------------------------------------------
5 
6 #include "Accessory.hpp"
7 #include "AccessoryBaseLight.hpp"
8 
9 //-------------------------------------------------------------------
10 
11 #ifndef NO_LIGHT
12 
15 class AccessoryLight : public Accessory
16 {
17  private:
18  AccessoryBaseLight *pLight;
19 
20  public:
23 
30  void begin(Port *inpPort, unsigned long inId, unsigned long inBlinkDuration = 0, int inIntensity = 255);
35  inline void SetFading(uint8_t inStep, uint8_t inDelay) { this->pLight->SetFading(inStep, inDelay); }
36 
40  inline bool IsOn() const { return this->pLight->IsOn(); }
44  inline bool IsBlinking() const { return this->pLight->IsBlinking(); }
49  inline bool IsFading() const { return this->pLight->IsFading(); }
50 
56  void Event(unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0);
57 
61  inline void SetState(ACC_STATE inState) { this->pLight->SetState(inState); }
65  inline ACC_STATE Toggle() { return this->pLight->Toggle(); }
67  inline void LightOn() { this->pLight->LightOn(); }
69  inline void LightOff() { this->pLight->LightOff(); }
71  inline void Blink() { this->pLight->Blink(); }
72 
73 #ifndef NO_EEPROM
74 
77  int EEPROMLoad(int inPos);
78 #endif
79 
80  private:
81  inline bool IsGroupActionPending() { return this->pLight->IsGroupActionPending(); }
82  inline void StartAction() { this->pLight->StartAction(); }
83  inline bool ActionEnded() { return this->pLight->ActionEnded(); }
84  inline void ResetAction() { return this->ResetStartingMillis(); }
85 
86  void Move(unsigned long inId);
87 
88 #ifdef ACCESSORIES_PRINT_ACCESSORIES
89  public:
93  void printAccessory();
94 #endif
95 };
96 #endif
97 
98 
99 //-------------------------------------------------------------------
100 #endif
101 //-------------------------------------------------------------------
void ResetStartingMillis()
Definition: Accessory.hpp:446
int EEPROMLoad(int inPos)
ACC_STATE Toggle()
void SetState(ACC_STATE inState)
bool IsFading() const
bool IsBlinking() const
bool IsOn() const
void SetFading(uint8_t inStep, uint8_t inDelay)
void Event(unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0)
void SetFading(uint8_t inStep, uint8_t inDelay)
Definition: Port.hpp:61
void begin(Port *inpPort, unsigned long inId, unsigned long inBlinkDuration = 0, int inIntensity = 255)