diff --git a/Lighting.cpp b/Lighting.cpp index 4c9471c..6aefd2c 100644 --- a/Lighting.cpp +++ b/Lighting.cpp @@ -61,6 +61,8 @@ void Lighting::updateRGB(int now) { void Lighting::updateWhite(){ float brightness = (_heatIndex - 0.5) / 0.5; + if (brightness<0) + brightness = 0; analogWrite(_whitePin, 1024 * brightness); }