From 2572c7c52204df9162a5340461c4539258b97727 Mon Sep 17 00:00:00 2001 From: andysheen Date: Mon, 12 Oct 2020 10:02:22 +0100 Subject: [PATCH 1/2] added catch to ensure led is fully off when at zero --- rgbled.ino | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rgbled.ino b/rgbled.ino index a44b7a6..9356e30 100644 --- a/rgbled.ino +++ b/rgbled.ino @@ -26,14 +26,23 @@ void rgbLedHandler() { if (ledChanged[USERLED]) { ledChanged[USERLED] = false; saturation[USERLED] = 255; - leds[USERLED] = CHSV(hue[USERLED], saturation[USERLED], value[USERLED]); + if (value[USERLED] == 0) { + //Turn off + leds[USERLED] = CHSV(0, 0, 0); + } else { + leds[USERLED] = CHSV(hue[USERLED], saturation[USERLED], value[USERLED]); + } FastLED.show(); } if (ledChanged[REMOTELED]) { ledChanged[REMOTELED] = false; saturation[REMOTELED] = 255; - // value[REMOTELED] = 255; - leds[REMOTELED] = CHSV(hue[REMOTELED], saturation[REMOTELED], value[REMOTELED]); + if (value[REMOTELED] == 0) { + //turn off + leds[REMOTELED] = CHSV(0, 0, 0); + } else { + leds[REMOTELED] = CHSV(hue[REMOTELED], saturation[REMOTELED], value[REMOTELED]); + } FastLED.show(); } //long fade From 4da95d6ab79eff8f3dc28c60d17ad5f9deb8f9ec Mon Sep 17 00:00:00 2001 From: andysheen Date: Mon, 12 Oct 2020 12:12:27 +0100 Subject: [PATCH 2/2] added snappiness back to user led --- utility.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/utility.ino b/utility.ino index c11ecae..2288112 100644 --- a/utility.ino +++ b/utility.ino @@ -125,6 +125,7 @@ void handleTouchEvent(AceButton* button, uint8_t eventType, uint8_t buttonState) } else { ledChanged[USERLED] = true; fadeRGB(USERLED); + isFadingRGB[USERLED] = false; startLongFade(USERLED); socketIO_sendColour(); }