forked from svn2github/led-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CctLamp.h
66 lines (48 loc) · 1.72 KB
/
CctLamp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* CctLamp.h
*
* Copyright (c) 2011
* Remco Magielse & Serge Offermans
* Intelligent Lighting Institute (ILI), TU/e.
*
* All rights reserved. LAST UPDATE: 13-08-2012
*/
#ifndef Cct_h
#define Cct_h
#include "LED.h"
/** The CctLamp class is used to manage lamps with variable color temperature using 2 channels (warm and cool white) **/
class CctLamp:public LED
{
public:
CctLamp( uint16_t channelWarm , uint16_t channelCool , bool autoWrite = true );
CctLamp( uint16_t channelWarm , uint16_t channelCool , bool autoWrite , uint16_t x, uint16_t y );
~CctLamp();
void update();
void setChannel( uint16_t channelWarm, uint16_t channelCool = 0);
void cctTo( int cct , uint32_t duration = DEFAULT_DURATION);
void cctLampTo( int intens , int cct, uint32_t duration = DEFAULT_DURATION);
void setCct( int cct, bool stopAnimation = true );
// Possibly include void setCctLamp( uint8_t intens , uint8_t cct );
void setAnimationType( uint8_t animType = LINEAR, bool easeIn = true, bool easeOut = true );
uint8_t getCct();
uint8_t getTargetCct();
uint8_t getIntensityWarm();
uint8_t getIntensityCool();
uint16_t getChannelWarm();
uint16_t getChannelCool();
bool isAnimating();
bool isAnimating(uint8_t param);
private:
/** cctAnim is the object that is used to manage the color temperature animations **/
Animation * cctAnim;
void setIntensityWarm( uint8_t intensityWarm );
void setIntensityCool( uint8_t intensityCool );
uint16_t _channelWarm;
uint16_t _channelCool;
uint8_t _cct;
uint8_t _intensityWarm;
uint8_t _intensityCool;
uint8_t calculateIntensityWarm();
uint8_t calculateIntensityCool();
};
#endif