From fc0c6d80d5f12a4fa037949490fcfff062e062d0 Mon Sep 17 00:00:00 2001 From: Matthew Szymanski Date: Sat, 25 Jul 2026 22:29:33 -0700 Subject: [PATCH 1/4] enhancement: add IntelliTect celebration pattern --- sketch_esp8266/sketch_esp8266.ino | 1 + .../src/Patterns/IntelliTectPattern.h | 82 +++++++++++++++++++ sketch_esp8266/src/Patterns/Patterns.h | 3 +- 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 sketch_esp8266/src/Patterns/IntelliTectPattern.h diff --git a/sketch_esp8266/sketch_esp8266.ino b/sketch_esp8266/sketch_esp8266.ino index 7c062f8..096af38 100644 --- a/sketch_esp8266/sketch_esp8266.ino +++ b/sketch_esp8266/sketch_esp8266.ino @@ -45,6 +45,7 @@ void setup() { _CelebrationPatterns[1] = new StarBurst(); _CelebrationPatterns[2] = new Seahawks(); _CelebrationPatterns[3] = new ReverseRainbowStarBurst(); + _CelebrationPatterns[4] = new IntelliTectPattern(); //_CelebrationPatterns[4] = new RandomColorCircle(); diff --git a/sketch_esp8266/src/Patterns/IntelliTectPattern.h b/sketch_esp8266/src/Patterns/IntelliTectPattern.h new file mode 100644 index 0000000..28da37a --- /dev/null +++ b/sketch_esp8266/src/Patterns/IntelliTectPattern.h @@ -0,0 +1,82 @@ +#ifndef IntelliTectPattern_h +#define IntelliTectPattern_h + +#include "Arduino.h" +#include +#include "../CelebrationPattern.h" +#include "../LedDisplayConf.h" +#include "../UtilityFunctions.h" + +class IntelliTectPattern : public CelebrationPattern +{ + private: + static const CRGB _IntelliTectBlue; + + public: + IntelliTectPattern() + { + m_speed = 20; + }; + + bool draw(CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP], bool someoneJustScored = false) + { + static uint8_t sequence = 0; + static uint8_t radius = 0; + static uint8_t pulseFrame = 0; + + if (someoneJustScored) + { + sequence = 0; + radius = 0; + pulseFrame = 0; + } + + switch (sequence) + { + case 0: + { + FastLED.clear(); + const uint8_t center = NUM_LEDS_PER_STRIP / 2; + const uint8_t ringWidth = 4; + + for (uint8_t i = 0; i < NUM_LEDS_PER_STRIP; i++) + { + uint8_t dist = (i > center) ? (i - center) : (center - i); + if (dist <= radius) + { + bool isBlue = (dist / ringWidth) % 2 == 0; + leds[0][i] = isBlue ? _IntelliTectBlue : CRGB::White; + } + } + + DuplicateToOtherStrips(leds); + radius++; + + if (radius > center) + { + sequence = 1; + pulseFrame = 0; + } + break; + } + + case 1: + { + for (uint8_t s = 0; s < NUM_STRIPS; s++) + for (uint8_t i = 0; i < NUM_LEDS_PER_STRIP; i++) + leds[s][i] = _IntelliTectBlue; + + pulseFrame++; + if (pulseFrame > 12) + return true; + break; + } + } + + return false; + } +}; + +const CRGB IntelliTectPattern::_IntelliTectBlue = CRGB(31, 112, 185); + +#endif diff --git a/sketch_esp8266/src/Patterns/Patterns.h b/sketch_esp8266/src/Patterns/Patterns.h index 841d830..b51e2e6 100644 --- a/sketch_esp8266/src/Patterns/Patterns.h +++ b/sketch_esp8266/src/Patterns/Patterns.h @@ -3,7 +3,7 @@ #ifndef Patterns_h #define Patterns_h -#define NUM_PATTERNS 4 +#define NUM_PATTERNS 5 // You need to import Arduino.h to write a custom library #include "Arduino.h" @@ -13,5 +13,6 @@ #include "./Seahawks.h" //#include "./RandomColorCircle.h" // not working yet #include "./ReverseRainbowStarBurst.h" +#include "./IntelliTectPattern.h" #endif \ No newline at end of file From af161deeccabb1b8687e9d5455fd8037b65a392f Mon Sep 17 00:00:00 2001 From: Matthew Szymanski Date: Thu, 30 Jul 2026 17:57:56 -0700 Subject: [PATCH 2/4] incremental work include comments following pattern format --- sketch_esp8266/src/Patterns/IntelliTectPattern.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sketch_esp8266/src/Patterns/IntelliTectPattern.h b/sketch_esp8266/src/Patterns/IntelliTectPattern.h index 28da37a..d497514 100644 --- a/sketch_esp8266/src/Patterns/IntelliTectPattern.h +++ b/sketch_esp8266/src/Patterns/IntelliTectPattern.h @@ -24,6 +24,7 @@ class IntelliTectPattern : public CelebrationPattern static uint8_t radius = 0; static uint8_t pulseFrame = 0; + // reset your pattern to play from the beginning if someoneJustScored if (someoneJustScored) { sequence = 0; @@ -34,7 +35,7 @@ class IntelliTectPattern : public CelebrationPattern switch (sequence) { case 0: - { + // expanding rings of blue and white outward from center FastLED.clear(); const uint8_t center = NUM_LEDS_PER_STRIP / 2; const uint8_t ringWidth = 4; @@ -52,25 +53,25 @@ class IntelliTectPattern : public CelebrationPattern DuplicateToOtherStrips(leds); radius++; + // transition to pulse when rings reach the ends if (radius > center) { sequence = 1; pulseFrame = 0; } break; - } case 1: - { + // full IntelliTect blue pulse for (uint8_t s = 0; s < NUM_STRIPS; s++) for (uint8_t i = 0; i < NUM_LEDS_PER_STRIP; i++) leds[s][i] = _IntelliTectBlue; pulseFrame++; + // hold the pulse then return true if (pulseFrame > 12) return true; break; - } } return false; From 9d2d5377c99adae393f7b5825823f71914a0b9ee Mon Sep 17 00:00:00 2001 From: Matthew Szymanski Date: Thu, 30 Jul 2026 18:08:42 -0700 Subject: [PATCH 3/4] enhancement: add black to IntelliTect pattern rings --- sketch_esp8266/src/Patterns/IntelliTectPattern.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sketch_esp8266/src/Patterns/IntelliTectPattern.h b/sketch_esp8266/src/Patterns/IntelliTectPattern.h index d497514..2d1dbdb 100644 --- a/sketch_esp8266/src/Patterns/IntelliTectPattern.h +++ b/sketch_esp8266/src/Patterns/IntelliTectPattern.h @@ -45,8 +45,13 @@ class IntelliTectPattern : public CelebrationPattern uint8_t dist = (i > center) ? (i - center) : (center - i); if (dist <= radius) { - bool isBlue = (dist / ringWidth) % 2 == 0; - leds[0][i] = isBlue ? _IntelliTectBlue : CRGB::White; + uint8_t ring = (dist / ringWidth) % 3; + switch (ring) + { + case 0: leds[0][i] = _IntelliTectBlue; break; + case 1: leds[0][i] = CRGB::White; break; + case 2: leds[0][i] = CRGB::Black; break; + } } } From be3012f2cac0eab7f4333e0c96455b60bcae50db Mon Sep 17 00:00:00 2001 From: Matthew Szymanski Date: Thu, 30 Jul 2026 18:18:57 -0700 Subject: [PATCH 4/4] fix: GCC "jump to case label crosses initialization" error --- sketch_esp8266/src/Patterns/IntelliTectPattern.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sketch_esp8266/src/Patterns/IntelliTectPattern.h b/sketch_esp8266/src/Patterns/IntelliTectPattern.h index 2d1dbdb..75cffae 100644 --- a/sketch_esp8266/src/Patterns/IntelliTectPattern.h +++ b/sketch_esp8266/src/Patterns/IntelliTectPattern.h @@ -35,6 +35,7 @@ class IntelliTectPattern : public CelebrationPattern switch (sequence) { case 0: + { // expanding rings of blue and white outward from center FastLED.clear(); const uint8_t center = NUM_LEDS_PER_STRIP / 2; @@ -65,8 +66,10 @@ class IntelliTectPattern : public CelebrationPattern pulseFrame = 0; } break; + } case 1: + { // full IntelliTect blue pulse for (uint8_t s = 0; s < NUM_STRIPS; s++) for (uint8_t i = 0; i < NUM_LEDS_PER_STRIP; i++) @@ -77,6 +80,7 @@ class IntelliTectPattern : public CelebrationPattern if (pulseFrame > 12) return true; break; + } } return false;