From bdaef7e5418266ffa43b12158001a9217f0db0ed Mon Sep 17 00:00:00 2001 From: Munsterlander Date: Sun, 6 Dec 2020 23:33:08 -0800 Subject: [PATCH] Adding a candy cane mode (#1445) * Adding Candy Cane mode * Added Candy Cane mode --- wled00/FX.cpp | 6 ++++++ wled00/FX.h | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index cc96987a..d95cc351 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -990,6 +990,12 @@ uint16_t WS2812FX::mode_merry_christmas(void) { return running(RED, GREEN); } +/* + * Alternating red/white pixels running. + */ +uint16_t WS2812FX::mode_candy_cane(void) { + return running(RED, WHITE); +} /* * Alternating orange/purple pixels running. diff --git a/wled00/FX.h b/wled00/FX.h index ae9b1811..7fddafbe 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -232,6 +232,7 @@ #define FX_MODE_CHUNCHUN 111 #define FX_MODE_DANCING_SHADOWS 112 #define FX_MODE_WASHING_MACHINE 113 +#define FX_MODE_CANDY_CANE 114 class WS2812FX { typedef uint16_t (WS2812FX::*mode_ptr)(void); @@ -437,6 +438,7 @@ class WS2812FX { _mode[FX_MODE_CHUNCHUN] = &WS2812FX::mode_chunchun; _mode[FX_MODE_DANCING_SHADOWS] = &WS2812FX::mode_dancing_shadows; _mode[FX_MODE_WASHING_MACHINE] = &WS2812FX::mode_washing_machine; + _mode[FX_MODE_CANDY_CANE] = &WS2812FX::mode_candy_cane; _brightness = DEFAULT_BRIGHTNESS; currentPalette = CRGBPalette16(CRGB::Black); @@ -643,7 +645,8 @@ class WS2812FX { mode_flow(void), mode_chunchun(void), mode_dancing_shadows(void), - mode_washing_machine(void); + mode_washing_machine(void), + mode_candy_cane(void); private: NeoPixelWrapper *bus; @@ -731,7 +734,7 @@ const char JSON_mode_names[] PROGMEM = R"=====([ "Twinklefox","Twinklecat","Halloween Eyes","Solid Pattern","Solid Pattern Tri","Spots","Spots Fade","Glitter","Candle","Fireworks Starburst", "Fireworks 1D","Bouncing Balls","Sinelon","Sinelon Dual","Sinelon Rainbow","Popcorn","Drip","Plasma","Percent","Ripple Rainbow", "Heartbeat","Pacifica","Candle Multi", "Solid Glitter","Sunrise","Phased","Twinkleup","Noise Pal", "Sine","Phased Noise", -"Flow","Chunchun","Dancing Shadows","Washing Machine" +"Flow","Chunchun","Dancing Shadows","Washing Machine","Candy Cane" ])=====";