Hello, FastLED Users! I am in need of help. I am a newbie on coding and on working with addressable leds and I am currently working on a project that involves neopixels and an IR sensor.
I’m using the FastLed effects from Tweaking4All (see links below.) for my code. I currently like the fading effect of the Meteor Rain from Tweaking4All, but I would like to make it start from the center then outwards, ending on both ends of the strip, but I seem to have a bit of trouble in doing so and the fading effect is no longer present in the output of my program. ![]()
Here is part of the code below:
it is derived from both NEW KITT and METEOR RAIN from Tweaking4All Tutorials.
void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay, int ReturnDelay) {
setAll(0,0,0);
for(int i = 0; i < NUM_LEDS+NUM_LEDS; i++) {
// fade brightness all LEDs one step
for(int j=0; j<NUM_LEDS; j++) {
if( (!meteorRandomDecay) || (random(10)>5) ) {
fadeToBlack(j, meteorTrailDecay );
}
}
// draw meteor + NEW KITT
for(int i =((NUM_LEDS-meteorSize)/2); i>=0; i--) {
setAll(0,0,0);
setPixel(i, red/10, green/10, blue/10);
for(int j = 1; j <= meteorSize; j++) {
setPixel(i+j, red, green, blue);
}
setPixel(i+meteorSize+1, red/10, green/10, blue/10);
setPixel(NUM_LEDS-i, red/10, green/10, blue/10);
for(int j = 1; j <= meteorSize; j++) {
setPixel(NUM_LEDS-i-j, red, green, blue);
}
setPixel(NUM_LEDS-i-meteorSize-1, red/10, green/10, blue/10);
showStrip();
delay(SpeedDelay);
}
delay(ReturnDelay);
}
}
Thanks in advance!
LINKS: