diff --git a/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino b/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino index 177ca7d..f5a3e6d 100644 --- a/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino +++ b/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino @@ -222,12 +222,13 @@ void timeouts(){ if((t - lastAckTime) > 1000) { Serial.print("Ada\n"); // Send ACK string to host lastAckTime = t; // Reset counter - } - // If no data received for an extended time, turn off all LEDs. - if((t - lastByteTime) > SerialTimeout) { - memset(leds, 0, Num_Leds * sizeof(struct CRGB)); //filling Led array by zeroes - FastLED.show(); - lastByteTime = t; // Reset counter + + // If no data received for an extended time, turn off all LEDs. + if((t - lastByteTime) > SerialTimeout) { + memset(leds, 0, Num_Leds * sizeof(struct CRGB)); //filling Led array by zeroes + FastLED.show(); + lastByteTime = t; // Reset counter + } } }