Add support for PWM controlled white LED strip
This commit is contained in:
parent
1a3cf20025
commit
11c37b7180
3 changed files with 36 additions and 12 deletions
10
Lighting.h
10
Lighting.h
|
@ -12,7 +12,7 @@ DEFINE_GRADIENT_PALETTE(_sunrise_p) {
|
|||
};
|
||||
|
||||
class Lighting {
|
||||
int _ledCount;
|
||||
int _ledCount, _whitePin;
|
||||
NaturalLight* _naturalLight;
|
||||
Weather* _weather;
|
||||
float _cloudCoverLimit;
|
||||
|
@ -25,13 +25,19 @@ class Lighting {
|
|||
float _currentHeatIndex();
|
||||
float getIndexMultiplier(int now, int startTime, int endTime, bool swap);
|
||||
float getHeatIndex(int time);
|
||||
float getPaletteHeatIndex(int time);
|
||||
float getBrightness();
|
||||
float getPaletteBrightness();
|
||||
void updateRGB(int now);
|
||||
void updateWhite();
|
||||
|
||||
public:
|
||||
Lighting(int ledCount, NaturalLight* _naturalLight, Weather* _weather, float cloudCoverLimit);
|
||||
|
||||
template<uint8_t DATA_PIN> void setup() {
|
||||
template<uint8_t DATA_PIN, int WHITE_PIN> void setup() {
|
||||
FastLED.addLeds<WS2811, DATA_PIN, GRB>(_leds, _ledCount).setCorrection(TypicalSMD5050).setTemperature(Tungsten40W);
|
||||
_whitePin = WHITE_PIN;
|
||||
pinMode(_whitePin, OUTPUT);
|
||||
}
|
||||
void update(int time);
|
||||
float getCurrentHeatIndex() { return _heatIndex; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue