From 0e16794589906c778d164b2faf136be1f1f59ec0 Mon Sep 17 00:00:00 2001 From: David Madison Date: Fri, 5 May 2017 08:20:23 -0400 Subject: [PATCH] Changed 'SerialTimeout' to use seconds More intuitive to set, no change in functionality --- Arduino/LEDstream_FastLED/LEDstream_FastLED.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino b/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino index f5a3e6d..f95906b 100644 --- a/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino +++ b/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino @@ -19,9 +19,9 @@ static const uint8_t // --- Serial Settings static const unsigned long - SerialSpeed = 115200, // serial port speed, max available - SerialTimeout = 150000; // time before LEDs are shut off, if no data - // (150 seconds) + SerialSpeed = 115200; // serial port speed, max available +static const uint16_t + SerialTimeout = 150; // time before LEDs are shut off if no data (in seconds) // --- Optional Settings (uncomment to add) //#define CLEAR_ON_START // LEDs are cleared on reset @@ -224,7 +224,7 @@ void timeouts(){ lastAckTime = t; // Reset counter // If no data received for an extended time, turn off all LEDs. - if((t - lastByteTime) > SerialTimeout) { + if((t - lastByteTime) > SerialTimeout * 1000) { memset(leds, 0, Num_Leds * sizeof(struct CRGB)); //filling Led array by zeroes FastLED.show(); lastByteTime = t; // Reset counter