|
|
@@ -270,130 +270,6 @@ void clear_strip() {
|
|
|
FastLED.show();
|
|
|
}
|
|
|
|
|
|
-void animation_rainbow() {
|
|
|
- fill_rainbow(leds, NUM_LEDS, animation_i, animation_var_1);
|
|
|
- FastLED.show();
|
|
|
- animation_i++;
|
|
|
- animation_i %= 256;
|
|
|
- //Serial.println(animation_i);
|
|
|
- //Serial.println("Animation 1 step");
|
|
|
-}
|
|
|
-
|
|
|
-void animation_running() {
|
|
|
- //Serial.println("Animation 2 step");
|
|
|
- leds[animation_i] = CRGB(100, 255, 200);
|
|
|
- FastLED.show();
|
|
|
- animation_i++;
|
|
|
- if (animation_i >= NUMBER_OF_LEDS) {
|
|
|
- animation_i = 0;
|
|
|
- clear_strip();
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-void animation_chasing() {
|
|
|
- //Serial.println("Animation 2 step");
|
|
|
- clear_strip();
|
|
|
- leds[animation_i*3] = CRGB(100, 255, 200);
|
|
|
- leds[(animation_i*3 + 10*3) % (NUMBER_OF_LEDS)] = CRGB(100, 255, 200);
|
|
|
- leds[(animation_i*3 + 20*3) % (NUMBER_OF_LEDS)] = CRGB(100, 255, 200);
|
|
|
- leds[((NUMBER_OF_LEDS) - animation_i*3) - 1*3] = CRGB(0, 255, 255);
|
|
|
-
|
|
|
- leds[animation_i*3+1] = CRGB(100, 255, 200);
|
|
|
- leds[(animation_i*3+1 + 10*3) % (NUMBER_OF_LEDS)] = CRGB(100, 255, 200);
|
|
|
- leds[(animation_i*3+1 + 20*3) % (NUMBER_OF_LEDS)] = CRGB(100, 255, 200);
|
|
|
- leds[((NUMBER_OF_LEDS) - animation_i*3+1) - 1*3] = CRGB(0, 255, 255);
|
|
|
-
|
|
|
- leds[animation_i*3+2] = CRGB(100, 255, 200);
|
|
|
- leds[(animation_i*3+2 + 10*3) % (NUMBER_OF_LEDS)] = CRGB(100, 255, 200);
|
|
|
- leds[(animation_i*3+2 + 20*3) % (NUMBER_OF_LEDS)] = CRGB(100, 255, 200);
|
|
|
- leds[((NUMBER_OF_LEDS) - animation_i*3+2) - 1*3] = CRGB(0, 255, 255);
|
|
|
- // leds[(50 - animation_i - 10)] = CRGB(0, 255, 255);
|
|
|
- // leds[(50 - animation_i)] = CRGB(0, 255, 255);
|
|
|
- FastLED.show();
|
|
|
- animation_i++;
|
|
|
- animation_i %= NUMBER_OF_LEDS/3;
|
|
|
-}
|
|
|
-
|
|
|
-void animation_off() {
|
|
|
- clear_strip();
|
|
|
- animation_step_time = 10000;
|
|
|
-}
|
|
|
-
|
|
|
-void animation_random1() {
|
|
|
- int difference = NUM_LEDS / animation_var_1;
|
|
|
-
|
|
|
- for (int i = 0; i < animation_var_1; i++) {
|
|
|
- int howManyCycles = animation_table_1[i][7];
|
|
|
- int currentStep = animation_table_1[i][6];
|
|
|
- uint8_t startRed = animation_table_1[i][0];
|
|
|
- uint8_t startGreen = animation_table_1[i][1];
|
|
|
- uint8_t startBlue = animation_table_1[i][2];
|
|
|
- uint8_t goalRed = animation_table_1[i][3];
|
|
|
- uint8_t goalGreen = animation_table_1[i][4];
|
|
|
- uint8_t goalBlue = animation_table_1[i][5];
|
|
|
- uint8_t r = (goalRed - startRed) * currentStep / howManyCycles + startRed;
|
|
|
- uint8_t g = (goalGreen - startGreen) * currentStep / howManyCycles + startGreen;
|
|
|
- uint8_t b = (goalBlue - startBlue) * currentStep / howManyCycles + startBlue;
|
|
|
-
|
|
|
-// for (int led = 0; led < 10; led++) {
|
|
|
-// leds[led + i * 10] = CRGB(r, b, g);
|
|
|
-// }
|
|
|
- leds[i * difference] = CRGB(r, b, g);
|
|
|
-
|
|
|
- animation_table_1[i][6] += 1;
|
|
|
-
|
|
|
- if (currentStep >= howManyCycles) {
|
|
|
- // uint8_t newR = (uint8_t) random(0, 255);
|
|
|
- // uint8_t newG = (uint8_t) random(0, 255);
|
|
|
- // uint8_t newB = (uint8_t) random(0, 255);
|
|
|
-
|
|
|
- uint8_t newH = (uint8_t) random(0, 255);
|
|
|
- uint8_t newS = (uint8_t) random(200, 255);
|
|
|
- CRGB newColor = CRGB(0, 0, 0);
|
|
|
- newColor.setHSV(newH, newS, 255);
|
|
|
-
|
|
|
- animation_table_1[i][3] = newColor.r;
|
|
|
- animation_table_1[i][4] = newColor.g;
|
|
|
- animation_table_1[i][5] = newColor.b;
|
|
|
-
|
|
|
- uint8_t steps = (uint8_t) random(50, 255);
|
|
|
- animation_table_1[i][0] = r;
|
|
|
- animation_table_1[i][1] = g;
|
|
|
- animation_table_1[i][2] = b;
|
|
|
- animation_table_1[i][7] = steps;
|
|
|
- animation_table_1[i][6] = 0;
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- for (int i = 0; i < animation_var_1; i++) {
|
|
|
- uint8_t startRed = leds[i * difference].r;
|
|
|
- uint8_t startGreen = leds[i * difference].g;
|
|
|
- uint8_t startBlue = leds[i * difference].b;
|
|
|
- uint8_t goalRed = leds[((i + 1) * difference) % NUM_LEDS].r;
|
|
|
- uint8_t goalGreen = leds[((i + 1) * difference) % NUM_LEDS].g;
|
|
|
- uint8_t goalBlue = leds[((i + 1) * difference) % NUM_LEDS].b;
|
|
|
- for (int currentStep = 1; currentStep < difference; currentStep++) {
|
|
|
- uint8_t r = (goalRed - startRed) * currentStep / difference + startRed;
|
|
|
- uint8_t g = (goalGreen - startGreen) * currentStep / difference + startGreen;
|
|
|
- uint8_t b = (goalBlue - startBlue) * currentStep / difference + startBlue;
|
|
|
- leds[currentStep + i*difference] = CRGB(r, g, b);
|
|
|
- }
|
|
|
- }
|
|
|
- FastLED.show();
|
|
|
-}
|
|
|
-
|
|
|
-void animation_rgb_light() {
|
|
|
- FastLED.clear();
|
|
|
- for (int i = 0; i < NUM_LEDS/3; i++) {
|
|
|
- leds[i] = CRGB(255, 0, 0);
|
|
|
- leds[(i + NUM_LEDS/3) % NUM_LEDS] = CRGB(0, 255, 0);
|
|
|
- leds[(i + (NUM_LEDS/3)*2) % NUM_LEDS] = CRGB(0, 0, 255);
|
|
|
- }
|
|
|
- FastLED.show();
|
|
|
- animation_i++;
|
|
|
- animation_i %= NUM_LEDS/3;
|
|
|
-}
|
|
|
-
|
|
|
void animation_fade_help() {
|
|
|
int leds1 = animation_table_1[0][0];
|
|
|
int leds2 = animation_table_1[0][1];
|
|
|
@@ -422,30 +298,6 @@ void animation_fade_help() {
|
|
|
FastLED.show();
|
|
|
}
|
|
|
|
|
|
-void setup_rainbow() {
|
|
|
- normal_setup();
|
|
|
- animation_var_1 = 4;
|
|
|
-}
|
|
|
-
|
|
|
-void normal_setup() {
|
|
|
- clear_strip();
|
|
|
- animation_step_time = 100;
|
|
|
- animation_i = 0;
|
|
|
- animation_var_1 = 0;
|
|
|
-}
|
|
|
-
|
|
|
-void setup_random1() {
|
|
|
- for (int i = 0; i < NUM_LEDS; i++) {
|
|
|
- for (int i = 0; i < 8; i++) {
|
|
|
- animation_table_1[i][i] = 0;
|
|
|
- }
|
|
|
- //Start R, Start G, Start B, fR, fG, fB, cycle, how many cycles
|
|
|
- }
|
|
|
- normal_setup();
|
|
|
- animation_var_1 = 10; //How many sections
|
|
|
- animation_step_time = 100;
|
|
|
-}
|
|
|
-
|
|
|
void setup_chosen(int lamps1, int lamps2, CRGB newColor, boolean doFade = false, int cycles = 20, int cycleLength = 100) {
|
|
|
animation_step_time = cycleLength;
|
|
|
animation_var_1 = (int) doFade;
|