HI Hans.
1) I have issue with some codes. I'm using your LED strip effects . But what I trying to do is. I'm trying to use three effects on one strip. First 5 LEDs light still , middle bit to cylon or other effect , and last 5 LEDs flashing.
So I manage to do 5 LEDs still with middle bit Fade In and Fade Out ..... but something is blocking me to flashing rest of the LEDs. So I named middle bit TREE and flashing bit as TOP and still bit is in loop . I know is not enough LEDs in middle bit array becase this is testing code and my strip have 68 LEDs.I'm only try to wrork couple effects on one strip. Ihave moment it was work for while 3 effects I mean, but the TOP bit was flashing after when the middle loop was finish( fade in and out).
2) Than another thing what I was thinkig of is METEOR effect . Hoe to make meteor go right after tail. Not to wait until all strip will be clear. Because I try to longer the Meteor tail or time etc. And new Meteor start run after last tail is dissapear. So my question is if is possible to make it your METEOR cde this way. And which line in this code is responsible for that.
P.S. I didnt put code of meteor here . This code below is only for issue number 1.Thank you.
#include "FastLED.h"
#define NUM_LEDS 68
CRGB leds[NUM_LEDS];
#define PIN 6
#define NUM_TREE_LEDS 41
int Tree[NUM_TREE_LEDS]={3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43};
#define NUM_TOP_LEDS 2
int Top[NUM_TOP_LEDS]={66,67};
void setup()
{
FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
}
void showStrip() {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.show();
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
FastLED.show();
#endif
}
void setPixel(int Pixel, byte red, byte green, byte blue) {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.setPixelColor(Pixel, strip.Color(red, green, blue));
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
leds[Pixel].r = red;
leds[Pixel].g = green;
leds[Pixel].b = blue;
#endif
}
void setAll(byte red, byte green, byte blue) {
for(int i = 3; i < NUM_TREE_LEDS; i++ ) { // here is change to TREE
setPixel(i, red, green, blue);
}
showStrip();
}
void loop() {
for(int i=0; i<3; i++){ // this is still bit
leds[i]=CRGB(10,10,0);
FastLED.show();}
for(int a=0;a<256 ;a++){ //this should be a TOP bit
leds[Top]=CRGB(20,20,20);
}
// FastLED.show();
delay (10);
FastLED.show();
for (int a=255;a>0;a--){
leds[Top]=CRGB(0,0,0);
}
delay(10);
FastLED.show();
RGBLoop();
}
void RGBLoop(){
for(int j = 0; j < 3; j++ ) {
// Fade IN
for(int Tree = 0; Tree < 256; Tree++) {
switch(j) {
case 0: setAll(Tree,0,0); break;
case 1: setAll(0,Tree,0); break;
case 2: setAll(0,0,Tree); break;
}
showStrip();
delay(3);
}
// Fade OUT
for(int Tree = 255; Tree >= 0; Tree--) {
switch(j) {
case 0: setAll(Tree,0,0); break;
case 1: setAll(0,Tree,0); break;
case 2: setAll(0,0,Tree); break;
}
showStrip();
delay(3);
}
}
}