|
|
|
@ -1,9 +1,8 @@
|
|
|
|
|
#include "Kaleidoscope-LEDEffect-Rainbow.h"
|
|
|
|
|
|
|
|
|
|
LEDRainbowEffect_::LEDRainbowEffect_(void) {
|
|
|
|
|
}
|
|
|
|
|
namespace kaleidoscope {
|
|
|
|
|
|
|
|
|
|
void LEDRainbowEffect_::update(void) {
|
|
|
|
|
void LEDRainbowEffect::update(void) {
|
|
|
|
|
if (rainbow_current_ticks++ < rainbow_ticks) {
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
@ -16,21 +15,17 @@ void LEDRainbowEffect_::update(void) {
|
|
|
|
|
if (rainbow_hue >= 255) {
|
|
|
|
|
rainbow_hue -= 255;
|
|
|
|
|
}
|
|
|
|
|
LEDControl.set_all_leds_to(rainbow);
|
|
|
|
|
::LEDControl.set_all_leds_to(rainbow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LEDRainbowEffect_::brightness(byte brightness) {
|
|
|
|
|
void LEDRainbowEffect::brightness(byte brightness) {
|
|
|
|
|
rainbow_value = brightness;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LEDRainbowEffect_ LEDRainbowEffect;
|
|
|
|
|
|
|
|
|
|
// ---------
|
|
|
|
|
|
|
|
|
|
LEDRainbowWaveEffect_::LEDRainbowWaveEffect_(void) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LEDRainbowWaveEffect_::update(void) {
|
|
|
|
|
void LEDRainbowWaveEffect::update(void) {
|
|
|
|
|
if (rainbow_current_ticks++ < rainbow_wave_ticks) {
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
@ -43,7 +38,7 @@ void LEDRainbowWaveEffect_::update(void) {
|
|
|
|
|
key_hue -= 255;
|
|
|
|
|
}
|
|
|
|
|
cRGB rainbow = hsvToRgb(key_hue, rainbow_saturation, rainbow_value);
|
|
|
|
|
LEDControl.setCrgbAt(i, rainbow);
|
|
|
|
|
::LEDControl.setCrgbAt(i, rainbow);
|
|
|
|
|
}
|
|
|
|
|
rainbow_hue += rainbow_wave_steps;
|
|
|
|
|
if (rainbow_hue >= 255) {
|
|
|
|
@ -51,8 +46,10 @@ void LEDRainbowWaveEffect_::update(void) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LEDRainbowWaveEffect_::brightness(byte brightness) {
|
|
|
|
|
void LEDRainbowWaveEffect::brightness(byte brightness) {
|
|
|
|
|
rainbow_value = brightness;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LEDRainbowWaveEffect_ LEDRainbowWaveEffect;
|
|
|
|
|
kaleidoscope::LEDRainbowEffect LEDRainbowEffect;
|
|
|
|
|
kaleidoscope::LEDRainbowWaveEffect LEDRainbowWaveEffect;
|
|
|
|
|