From 37e17bd4412d4a2ea25ea0c735493a4bb71cd6af Mon Sep 17 00:00:00 2001 From: Noah Date: Mon, 18 Dec 2017 00:01:21 -0800 Subject: [PATCH 1/3] radiating rainbow colors from center --- RGBShades.ino | 4 +++- effects.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/RGBShades.ino b/RGBShades.ino index 5583378..bf01afe 100644 --- a/RGBShades.ino +++ b/RGBShades.ino @@ -56,7 +56,9 @@ void setup() { } // list of functions that will be displayed -functionList effectList[] = {threeSine, +functionList effectList[] = {radiateCenter, + hueRotation, + threeSine, threeDee, scrollTextOne, plasma, diff --git a/effects.h b/effects.h index 6140c2a..c6ae4d4 100644 --- a/effects.h +++ b/effects.h @@ -6,6 +6,44 @@ // * All animation should be controlled with counters and effectDelay, no delay() or loops // * Pixel data should be written using leds[XY(x,y)] to map coordinates to the RGB Shades layout + +// radiating inward rainbow colors +void radiateCenter() { + static byte offset = 9; // counter for radial color wave motion + static int plasVector = 0; // counter for orbiting plasma center + + // startup tasks + if (effectInit == false) { + effectInit = true; + effectDelay = 0; + } + + int xOffset = 0; + int yOffset = 4; + + // Draw one frame of the animation into the LED array + for (int x = 0; x < kMatrixWidth; x++) { + for (int y = 0; y < kMatrixHeight; y++) { + byte color = sin8(sqrt(sq(((float)x - 7.5) * 12 + xOffset) + sq(((float)y - 2) * 12 + yOffset)) + offset); + leds[XY(x, y)] = ColorFromPalette(currentPalette, color, 255); + } + } + offset--; // wraps at 255 for sin8 + plasVector += 1; // using an int for slower orbit (wraps at 65536) +} + +// Hue Rotation +void hueRotation() { + + // startup tasks + if (effectInit == false) { + effectInit = true; + effectDelay = 5; + } + + fillAll(CHSV(cycleHue, 255, 255)); +} + // Triple Sine Waves byte sineOffset = 0; // counter for current position of sine waves void threeSine() { From bf382f36a37b6567106739b268ecb821a1cd6e17 Mon Sep 17 00:00:00 2001 From: Noah Date: Mon, 18 Dec 2017 00:10:13 -0800 Subject: [PATCH 2/3] Update effects.h --- effects.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/effects.h b/effects.h index c6ae4d4..1efd526 100644 --- a/effects.h +++ b/effects.h @@ -32,18 +32,6 @@ void radiateCenter() { plasVector += 1; // using an int for slower orbit (wraps at 65536) } -// Hue Rotation -void hueRotation() { - - // startup tasks - if (effectInit == false) { - effectInit = true; - effectDelay = 5; - } - - fillAll(CHSV(cycleHue, 255, 255)); -} - // Triple Sine Waves byte sineOffset = 0; // counter for current position of sine waves void threeSine() { @@ -426,4 +414,4 @@ void scrollTextOne() { void scrollTextTwo() { scrollText(2, NORMAL, CRGB::Green, CRGB(0,0,8)); -} \ No newline at end of file +} From e5f10ef3eb17de2e149d2cee94f23c5edc258baf Mon Sep 17 00:00:00 2001 From: Noah Date: Mon, 18 Dec 2017 00:11:35 -0800 Subject: [PATCH 3/3] removed previous animation --- RGBShades.ino | 1 - effects.h | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/RGBShades.ino b/RGBShades.ino index bf01afe..9910c48 100644 --- a/RGBShades.ino +++ b/RGBShades.ino @@ -57,7 +57,6 @@ void setup() { // list of functions that will be displayed functionList effectList[] = {radiateCenter, - hueRotation, threeSine, threeDee, scrollTextOne, diff --git a/effects.h b/effects.h index c6ae4d4..8810c10 100644 --- a/effects.h +++ b/effects.h @@ -32,18 +32,6 @@ void radiateCenter() { plasVector += 1; // using an int for slower orbit (wraps at 65536) } -// Hue Rotation -void hueRotation() { - - // startup tasks - if (effectInit == false) { - effectInit = true; - effectDelay = 5; - } - - fillAll(CHSV(cycleHue, 255, 255)); -} - // Triple Sine Waves byte sineOffset = 0; // counter for current position of sine waves void threeSine() {