Adding a candy cane mode (#1445)

* Adding Candy Cane mode

* Added Candy Cane mode
This commit is contained in:
Munsterlander 2020-12-06 23:33:08 -08:00 committed by GitHub
parent aab2e4555a
commit bdaef7e541
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -990,6 +990,12 @@ uint16_t WS2812FX::mode_merry_christmas(void) {
return running(RED, GREEN); 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. * Alternating orange/purple pixels running.

View File

@ -232,6 +232,7 @@
#define FX_MODE_CHUNCHUN 111 #define FX_MODE_CHUNCHUN 111
#define FX_MODE_DANCING_SHADOWS 112 #define FX_MODE_DANCING_SHADOWS 112
#define FX_MODE_WASHING_MACHINE 113 #define FX_MODE_WASHING_MACHINE 113
#define FX_MODE_CANDY_CANE 114
class WS2812FX { class WS2812FX {
typedef uint16_t (WS2812FX::*mode_ptr)(void); typedef uint16_t (WS2812FX::*mode_ptr)(void);
@ -437,6 +438,7 @@ class WS2812FX {
_mode[FX_MODE_CHUNCHUN] = &WS2812FX::mode_chunchun; _mode[FX_MODE_CHUNCHUN] = &WS2812FX::mode_chunchun;
_mode[FX_MODE_DANCING_SHADOWS] = &WS2812FX::mode_dancing_shadows; _mode[FX_MODE_DANCING_SHADOWS] = &WS2812FX::mode_dancing_shadows;
_mode[FX_MODE_WASHING_MACHINE] = &WS2812FX::mode_washing_machine; _mode[FX_MODE_WASHING_MACHINE] = &WS2812FX::mode_washing_machine;
_mode[FX_MODE_CANDY_CANE] = &WS2812FX::mode_candy_cane;
_brightness = DEFAULT_BRIGHTNESS; _brightness = DEFAULT_BRIGHTNESS;
currentPalette = CRGBPalette16(CRGB::Black); currentPalette = CRGBPalette16(CRGB::Black);
@ -643,7 +645,8 @@ class WS2812FX {
mode_flow(void), mode_flow(void),
mode_chunchun(void), mode_chunchun(void),
mode_dancing_shadows(void), mode_dancing_shadows(void),
mode_washing_machine(void); mode_washing_machine(void),
mode_candy_cane(void);
private: private:
NeoPixelWrapper *bus; 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", "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", "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", "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"
])====="; ])=====";