<?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 - Scrolling a pattern of 4 forever ... - Arduino				            </title>
            <link>https://www.tweaking4all.com/forum/arduino/led-effects-scrolling-a-pattern-of-4-forever/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Mon, 15 Jun 2026 20:51:21 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: LED Effects - Scrolling a pattern of 4 forever ...</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-scrolling-a-pattern-of-4-forever/#post-2971</link>
                        <pubDate>Fri, 25 Dec 2020 11:07:13 +0000</pubDate>
                        <description><![CDATA[Hi Andre!
Merry Christmas to you as well.And I do apologize for not speaking French (English/Dutch/German I can do though).
Enjoy the holidays, stay healthy and have fun with the Arduino 😉]]></description>
                        <content:encoded><![CDATA[<p>Hi Andre!</p>
<p>Merry Christmas to you as well.<br />And I do apologize for not speaking French (English/Dutch/German I can do though).</p>
<p>Enjoy the holidays, stay healthy and have fun with the Arduino 😉 </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-scrolling-a-pattern-of-4-forever/#post-2971</guid>
                    </item>
				                    <item>
                        <title>RE: LED Effects - Scrolling a pattern of 4 forever ...</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-scrolling-a-pattern-of-4-forever/#post-2970</link>
                        <pubDate>Thu, 24 Dec 2020 16:10:27 +0000</pubDate>
                        <description><![CDATA[désolé pour la traduction
andre]]></description>
                        <content:encoded><![CDATA[<p>désolé pour la traduction</p>
<p>andre</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>andre</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-effects-scrolling-a-pattern-of-4-forever/#post-2970</guid>
                    </item>
				                    <item>
                        <title>RE: LED Effects - Scrolling a pattern of 4 forever ...</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-scrolling-a-pattern-of-4-forever/#post-2969</link>
                        <pubDate>Thu, 24 Dec 2020 16:08:41 +0000</pubDate>
                        <description><![CDATA[Andre
Hello Hans

Many thanks for the sketch

one part works division by 4 then all blocks

But its probably me the problem not yet competent for this type of programming

I am 70 y...]]></description>
                        <content:encoded><![CDATA[<p> </p>
<p>Andre</p>
<pre id="tw-target-text" class="tw-data-text tw-text-large XcVN5d tw-ta" data-placeholder="Traduction"><span>Hello Hans

Many thanks for the sketch

one part works division by 4 then all blocks

But its probably me the problem not yet competent for this type of programming

I am 70 years old and I started 6 months ago I continue my tests

for christmas photos how to do because 1st time in my life on a forum

I am registered on the forum

once again well thank you for the example I will try to do the sketch

I wish you a happy and merry christmas

Andre</span></pre>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>andre</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/led-effects-scrolling-a-pattern-of-4-forever/#post-2969</guid>
                    </item>
				                    <item>
                        <title>RE: LED Effects - Scrolling a pattern of 4 forever ...</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-scrolling-a-pattern-of-4-forever/#post-2927</link>
                        <pubDate>Thu, 17 Dec 2020 11:19:49 +0000</pubDate>
                        <description><![CDATA[Coming back to your question ...Let me first say: WOW! You have how many LEDs? Please send me pictures - that&#039;s impressive!
Since I&#039;m not sure how comfortable you are with code, here a star...]]></description>
                        <content:encoded><![CDATA[<p>Coming back to your question ...<br />Let me first say: WOW! You have how many LEDs? Please send me pictures - that's impressive!</p>
<p>Since I'm not sure how comfortable you are with code, here a started point on how I have done this in one of my other projects:</p>
<p>1. I recommend using the FastLED library, if you haven't already.<br />2. Fill the strip with the initially desired pattern (one time only).<br />3. Shift all LEDs one position (in a loop).<br />4. Fill in the "new" blank LED with the color you need (in the same loop as step 3).</p>
<p>So step 2 could look something like this (assuming you have defined red, green and blue):</p>
<pre>CRGB firstColor = CRGB(255,0,0); // define color of 1st LED<br />CRGB otherColor = CRGB(0,0,0);   // define color of other 3 LEDs<br /><br />for(int i=0; i&lt;NUM_LEDS; i=i+4) {<br />  led =firstColor; <br />  for(int j=1; j&lt;4; j++) {<br />    leds = otherColor;<br />  }<br />}</pre>
<p>Step 3 is very easy with<span> </span><strong>memmove8</strong><span> </span>(once you know<span> </span><a href="http://fastled.io/docs/3.1/group__lib8tion.html" target="_blank" rel="noopener">this function</a><span> </span>exists).<br />It takes 3 parameters: Destination, Source, Size, where size is the CRGB size times the number of LEDs we'd like to move:</p>
<pre>memmove8( &amp;leds, &amp;leds, (NUM_LEDS-1) * sizeof(CRGB) );</pre>
<p>So this moves all LEDs one position, where leds moves to leds, leds to leds, etc.</p>
<p>The only thing we now need to do is give leds the correct color. This can be done with a confusing function, or we can simply copy the 4th LED.</p>
<pre>Leds: X 0 0 0 X 0 0 0 X 0 0 0 X etc</pre>
<p>becomes</p>
<pre>Leds: <span style="color: #ff0000"><strong>?</strong></span> X 0 0 <span style="color: #0000ff"><strong>0</strong></span> X 0 0 0 X 0 0 0 etc</pre>
<p>So we need to determine "<span style="color: #ff0000"><strong>?</strong></span>", which is the same color as the <span style="color: #0000ff"><strong>position + 4</strong></span> (marked blue). <br />So in each step we do this followed by a delay that will influence how fast this effect will go:</p>
<pre>leds = leds;<br />delay(500); // 500 ms = ½ second delay</pre>
<p>So all combined this effect would look something like this:</p>
<pre>CRGB firstColor = CRGB(255,0,0); // define color of 1st LED<br />CRGB otherColor = CRGB(0,0,0); // define color of other 3 LEDs<br /><br />for(int i=0; i&lt;NUM_LEDS; i=i+4) {<br />  led = firstColor;      // set LED 0 of the pattern (counting starts with zero)<br />  for(int j=1; j&lt;4; j++) {  // set LEDs 1, 2 and 3 of the pattern<br />    leds = otherColor;<br />  }<br />}
<br />while(true) {<br />  memmove8( &amp;leds, &amp;leds, (NUM_LEDS-1) * sizeof(CRGB) );<br />  leds = leds;<br />  delay(500); <br />}</pre>
<p>I hope this will get you started, if not please feel free to ask questions here in this forum topic 😊 </p>
<p>Note: I have not tested this specific code and typed it all from memory, so there could be typos - I hope not though 😉 </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-scrolling-a-pattern-of-4-forever/#post-2927</guid>
                    </item>
				                    <item>
                        <title>LED Effects - Scrolling a pattern of 4 forever ...</title>
                        <link>https://www.tweaking4all.com/forum/arduino/led-effects-scrolling-a-pattern-of-4-forever/#post-2926</link>
                        <pubDate>Thu, 17 Dec 2020 11:13:38 +0000</pubDate>
                        <description><![CDATA[Based on Andre&#039;s question in the All-in-One LED Effects I started a forum topic to keep the code posts in the comment section to a minimum;

Hello Hans
Nice work and explanation for a nov...]]></description>
                        <content:encoded><![CDATA[<p>Based on <a href="https://www.tweaking4all.com/hardware/arduino/arduino-all-ledstrip-effects-in-one/#comment-523050" target="true">Andre's question in the All-in-One LED Effects</a> I started a forum topic to keep the code posts in the comment section to a minimum;</p>
<hr />
<p>Hello Hans</p>
<p>Nice work and explanation for a novice like me<br />I have 20,000 led Christmas exterior decorations donated 1500 rgb on Chinese programmer<br />i have an arduino mega 2560 and your script is working amazing<br />But I’m wondering if I can program a string of 96 rgb leds blinking in 4 state<br />example 1-5-9-13 until 96<br />               2-6-10-14 “”<br />               3-7-11-15 “”<br />               4-8-12-16 “”<br />this like simple led garland programmers<br />sorry i don’t speak english hence google translator<br />thank you for your response desolé mauvais manipulation</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-scrolling-a-pattern-of-4-forever/#post-2926</guid>
                    </item>
							        </channel>
        </rss>
		