<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									LED Effects- modified meteor rain chasing effect - Arduino				            </title>
            <link>https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Sat, 12 Sep 2026 20:04:34 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: LED Effects- modified meteor rain chasing effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2734</link>
                        <pubDate>Mon, 09 Nov 2020 13:21:28 +0000</pubDate>
                        <description><![CDATA[Awesome! And you&#039;re most welcome! 👍]]></description>
                        <content:encoded><![CDATA[<p>Awesome! And you're most welcome! 👍 </p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2734</guid>
                    </item>
				                    <item>
                        <title>RE: LED Effects- modified meteor rain chasing effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2733</link>
                        <pubDate>Mon, 09 Nov 2020 12:53:11 +0000</pubDate>
                        <description><![CDATA[Thank you SO much man, this works perfectly. thanks for the support
for (int i = 0; i &lt; NUM_LEDS; i++) {]]></description>
                        <content:encoded><![CDATA[<p>Thank you SO much man, this works perfectly. thanks for the support</p>
<pre>for (int i = 0; i &lt; NUM_LEDS; i++) {</pre>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>linoarthur</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2733</guid>
                    </item>
				                    <item>
                        <title>RE: LED Effects- modified meteor rain chasing effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2719</link>
                        <pubDate>Sat, 07 Nov 2020 15:41:29 +0000</pubDate>
                        <description><![CDATA[The &quot;start&quot; you mention, actually does not exist. There is nothing to &quot;initialize&quot;.What we need to look at is the &quot;ending&quot; - this probably chews op the 2 seconds ...
Just as an experiment, ...]]></description>
                        <content:encoded><![CDATA[<p>The "start" you mention, actually does not exist. There is nothing to "initialize".<br />What we need to look at is the "ending" - this probably chews op the 2 seconds ...</p>
<p>Just as an experiment, try this: change this line</p>
<pre>for (int i = 0; i &lt; NUM_LEDS <span style="color: #ff0000"><strong>+ NUM_LEDS</strong></span>; i++) {</pre>
<p>to this (remove "+ NUM_LEDS")</p>
<pre>for (int i = 0; i &lt; NUM_LEDS; i++) {</pre>
<p>This may speed up the "finishing". Downside is that some of the last pieces of the trail do not disappear all that elegantly.<br />So you could look at fine tuning this to maybe something like this:</p>
<pre>for (int i = 0; i &lt; NUM_LEDS <span style="color: #ff0000">+ meteorSize</span>; i++) { </pre>
<p>Give it a try and see what happens 😊 </p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2719</guid>
                    </item>
				                    <item>
                        <title>RE: LED Effects- modified meteor rain chasing effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2718</link>
                        <pubDate>Sat, 07 Nov 2020 15:16:59 +0000</pubDate>
                        <description><![CDATA[Thanks Hans i&#039;ll change that, and for the delay, meteorTrailDecay only modify how long the trail is showing and SpeedDelay how fast the effect goes, what i want is at the end of that speedDe...]]></description>
                        <content:encoded><![CDATA[<p>Thanks Hans i'll change that, and for the delay, <span>meteorTrailDecay only modify how long the trail is showing and SpeedDelay how fast the effect goes, what i want is at the end of that speedDelay it start faster again, actually the effect take like 5secs to go all the strip, and take like 2s to restart, i would like to reduce that like it goes round and round leaving the trace behind when the effect goes just like this meteor.</span></p>
<p> </p>
<p>Thanks again.</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>linoarthur</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2718</guid>
                    </item>
				                    <item>
                        <title>RE: LED Effects- modified meteor rain chasing effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2714</link>
                        <pubDate>Sat, 07 Nov 2020 10:36:21 +0000</pubDate>
                        <description><![CDATA[Hi linoarthur!
Welcome to the forum 😉 
First thing; to make things faster, I&#039;d recommend switching to the FastLED library. It&#039;s more mature, offers more functions and ... is just faster th...]]></description>
                        <content:encoded><![CDATA[<p>Hi linoarthur!</p>
<p>Welcome to the forum 😉 </p>
<p>First thing; to make things faster, I'd recommend switching to the FastLED library. It's more mature, offers more functions and ... is just faster than NeoPixel.<br />Because of the better functions, it can make your code a lot shorter as well!</p>
<p>I wrote my project at the time with both NeoPixel and FastLED in mind, and for that I had to write a few small "generic" functions.<br />FadeToBlack for example is much faster and easier to use in FastLED.</p>
<p>For example, remove the functions <strong>fadeToBlack</strong>, <strong>setPixelColor</strong>, <strong>showStrip</strong> and <strong>setPixel</strong> and replace all the calls to these functions like so:</p>
<p><strong>fadeToBlack(LedNo, FadeValue)</strong> -&gt; <span style="color: #0000ff"><strong>leds.fadeToBlackBy( fadeValue );</strong></span></p>
<p><strong>showStrip()</strong> -&gt; <span style="color: #0000ff"><strong>FastLED.show();</strong></span></p>
<p><strong>setPixel(Pixel, red, green, blue)</strong> -&gt; <span style="color: #0000ff"><strong>leds = CRGB(red, green, blue);</strong></span></p>
<p><strong>setAll(red, green, blue)</strong> -&gt; <span style="color: #0000ff"><strong>fill_solid( leds, NUM_LEDS, CRGB( red, green, blue) );</strong></span></p>
<p> </p>
<p>Next, your delay maybe caused by several things, but first thing I'd look at is the <span>meteorTrailDecay value.<br />It may take more time than expected when the LEDs are almost dark.</span></p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2714</guid>
                    </item>
				                    <item>
                        <title>LED Effects- modified meteor rain chasing effect</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2712</link>
                        <pubDate>Sat, 07 Nov 2020 01:35:59 +0000</pubDate>
                        <description><![CDATA[Hello guys, im completely new to arduino programing leds and i found this amazing forum, i simply modified the meteor rain parameters to make it look like a flash passing through and some fa...]]></description>
                        <content:encoded><![CDATA[<p>Hello guys, im completely new to arduino programing leds and i found this amazing forum, i simply modified the meteor rain parameters to make it look like a flash passing through and some fade behind it, my question is can i make this loop restart quicker ? i mean when all the effect go through the strip it takes like 2sec to restart. here is the code. thank you very much for any help</p>
<pre>#include

#define PIN 2
#define NUM_LEDS 60
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}
// ---------------------------------------------------
void loop() {
  meteorRain(0xff, 0x00, 0x00, 4, 22, true, 8);
}

void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {
  ;

  for (int i = 0; i &lt; NUM_LEDS + NUM_LEDS; i++) {

    // fade brightness all LEDs one step
    for (int j = 0; j &lt; NUM_LEDS; j++) {
      if ((!meteorRandomDecay) || (random(10) &gt; 5)) {
        fadeToBlack(j, meteorTrailDecay);
      }
    }

    // draw meteor
    for (int j = 0; j &lt; meteorSize; j++) {
      if ((i - j &lt; NUM_LEDS) &amp;&amp; (i - j &gt;= 0)) {
        setPixel(i - j, red, green, blue);
      }
    }

    showStrip();
    delay(SpeedDelay);
  }
}

void fadeToBlack(int ledNo, byte fadeValue) {
  #ifdef ADAFRUIT_NEOPIXEL_H
  // NeoPixel
  uint32_t oldColor;
  uint8_t r, g, b;
  int value;

  oldColor = strip.getPixelColor(ledNo);
  r = (oldColor &amp; 0x00ff0000 UL) &gt;&gt; 16;
  g = (oldColor &amp; 0x0000ff00 UL) &gt;&gt; 8;
  b = (oldColor &amp; 0x000000ff UL);

  r = (r &lt;= 10) ? 0 : (int) r - (r * fadeValue / 250);
  g = (g &lt;= 10) ? 0 : (int) g - (g * fadeValue / 250);
  b = (b &lt;= 10) ? 0 : (int) b - (b * fadeValue / 250);

  strip.setPixelColor(ledNo, r, g, b);
  #endif
  #ifndef ADAFRUIT_NEOPIXEL_H
  // FastLED
  leds.fadeToBlackBy(fadeValue);
  #endif
}
// -----------------------------------------
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.r = red;
  leds.g = green;
  leds.b = blue;
  #endif
}

void setAll(byte red, byte green, byte blue) {
  for (int i = 0; i &lt; NUM_LEDS; i++) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}</pre>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>linoarthur</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-effects-modified-meteor-rain-chasing-effect/#post-2712</guid>
                    </item>
							        </channel>
        </rss>
		