File tree Expand file tree Collapse file tree
Arduino/LEDstream_FastLED Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ static const uint8_t
3636static const unsigned long
3737 SerialSpeed = 115200 ; // serial port speed
3838static const uint16_t
39- SerialTimeout = 150 ; // time before LEDs are shut off if no data (in seconds)
39+ SerialTimeout = 60 ; // time before LEDs are shut off if no data (in seconds), 0 to disable
4040
4141// --- Optional Settings (uncomment to add)
4242#define SERIAL_FLUSH // Serial buffer cleared on LED latch
@@ -234,12 +234,12 @@ void dataSet(){
234234void timeouts (){
235235 // No data received. If this persists, send an ACK packet
236236 // to host once every second to alert it to our presence.
237- if ((t - lastAckTime) > 1000 ) {
237+ if ((t - lastAckTime) >= 1000 ) {
238238 Serial.print (" Ada\n " ); // Send ACK string to host
239239 lastAckTime = t; // Reset counter
240240
241241 // If no data received for an extended time, turn off all LEDs.
242- if ((t - lastByteTime) > SerialTimeout * 1000 ) {
242+ if (SerialTimeout != 0 && (t - lastByteTime) >= ( uint32_t ) SerialTimeout * 1000 ) {
243243 memset (leds, 0 , Num_Leds * sizeof (struct CRGB )); // filling Led array by zeroes
244244 FastLED.show ();
245245 mode = Header;
You can’t perform that action at this time.
0 commit comments