FIx for wierd lighting glitch (constantly halving in brightness, values not being returned, general fuckiness)
This commit is contained in:
parent
93b15c9ebb
commit
d382a4b0a2
2 changed files with 5 additions and 4 deletions
|
@ -9,7 +9,8 @@ Lighting::Lighting(int ledCount, NaturalLight* naturalLight, Weather* weather, f
|
|||
_weather = weather;
|
||||
_cloudCoverLimit = cloudCoverLimit;
|
||||
|
||||
_leds = CRGB(_ledCount);
|
||||
CRGB leds = CRGB(_ledCount);
|
||||
_leds = &leds;
|
||||
}
|
||||
|
||||
float Lighting::getIndexMultiplier(int now, int startTime, int endTime, bool swap) {
|
||||
|
@ -50,6 +51,6 @@ void Lighting::update(int now) {
|
|||
_nextLightningFlash = millis() + (random8(1, 60) * 1000);
|
||||
}
|
||||
|
||||
fill_solid(&_leds, _ledCount, colour);
|
||||
fill_solid(_leds, _ledCount, colour);
|
||||
FastLED.show();
|
||||
}
|
|
@ -15,7 +15,7 @@ class Lighting {
|
|||
NaturalLight* _naturalLight;
|
||||
Weather* _weather;
|
||||
float _cloudCoverLimit;
|
||||
CRGB _leds;
|
||||
CRGB* _leds;
|
||||
CRGBPalette16 _sunrise = _sunrise_p;
|
||||
long _nextLightningFlash = 0;
|
||||
float _heatIndex;
|
||||
|
@ -30,7 +30,7 @@ class Lighting {
|
|||
Lighting(int ledCount, NaturalLight* _naturalLight, Weather* _weather, float cloudCoverLimit);
|
||||
|
||||
template<uint8_t DATA_PIN> void setup() {
|
||||
FastLED.addLeds<WS2811, DATA_PIN, GRB>(&_leds, _ledCount).setCorrection(TypicalSMD5050).setTemperature(Tungsten40W);
|
||||
FastLED.addLeds<WS2811, DATA_PIN, GRB>(_leds, _ledCount).setCorrection(TypicalSMD5050).setTemperature(Tungsten40W);
|
||||
}
|
||||
void update(int time);
|
||||
float getCurrentHeatIndex() { return _heatIndex; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue