From 025fecb99be5b2f77e0d929d5d07d849f02d85a9 Mon Sep 17 00:00:00 2001 From: David Madison Date: Tue, 20 Dec 2016 04:47:22 -0500 Subject: [PATCH] Moved serial timeout variable below definitions --- Arduino/LEDstream_WS2812B/LEDstream_WS2812B.ino | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Arduino/LEDstream_WS2812B/LEDstream_WS2812B.ino b/Arduino/LEDstream_WS2812B/LEDstream_WS2812B.ino index 55ddf55..f34fbe1 100644 --- a/Arduino/LEDstream_WS2812B/LEDstream_WS2812B.ino +++ b/Arduino/LEDstream_WS2812B/LEDstream_WS2812B.ino @@ -9,6 +9,10 @@ #define BRIGHTNESS 255 // maximum brightness #define SPEED 115200 // serial port speed, max available +// If no serial data is received for a while, the LEDs are shut off +// automatically. Value in milliseconds. +static const unsigned long serialTimeout = 150000; // 150 seconds + CRGB leds[NUM_LEDS]; uint8_t * ledsRaw = (uint8_t *)leds; @@ -34,11 +38,6 @@ static const uint8_t magic[] = { #define MODE_HEADER 0 #define MODE_DATA 2 -// If no serial data is received for a while, the LEDs are shut off -// automatically. This avoids the annoying "stuck pixel" look when -// quitting LED display programs on the host computer. -static const unsigned long serialTimeout = 150000; // 150 seconds - void setup() { pinMode(GROUND_PIN, OUTPUT);