<?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>
									Assistance request with Arduino LED sketch - Arduino				            </title>
            <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Wed, 10 Jun 2026 00:00:34 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/paged/2/#post-2445</link>
                        <pubDate>Sun, 09 Aug 2020 11:06:08 +0000</pubDate>
                        <description><![CDATA[Thanks for the math David - you&#039;re totally right about the time. 👍 Having played with 300+ LEDs I had the &quot;delay&quot; but indeed not in a bad way.I could have been just me, since I never hooked ...]]></description>
                        <content:encoded><![CDATA[<p>Thanks for the math David - you're totally right about the time. 👍 <br />Having played with 300+ LEDs I had the "delay" but indeed not in a bad way.<br />I could have been just me, since I never hooked up more than 300 LEDs 😊 </p>
<p>(sorry the late reply - I'm traveling at the moment)</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/assistance-request-with-arduino-led-sketch/paged/2/#post-2445</guid>
                    </item>
				                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/paged/2/#post-2428</link>
                        <pubDate>Tue, 04 Aug 2020 20:12:24 +0000</pubDate>
                        <description><![CDATA[Posted by: @hans 
You&#039;re welcome - I had some time on my hands 😊 
You will not able to fix this in code.
Keep in mind: each of the white little squares on the strip contain a controller, ...]]></description>
                        <content:encoded><![CDATA[<blockquote data-userid="1" data-postid="2187" data-mention="hans">
<div class="wpforo-post-quote-author"><strong> Posted by: @hans </strong></div>
<p>You're welcome - I had some time on my hands 😊 </p>
<p>You will not able to fix this in code.</p>
<p>Keep in mind: each of the white little squares on the strip contain a <strong>controller</strong>, and <strong>3 LEDs</strong> (one for red, green and blue).</p>
<p>When all the data is send to the strip, data for all 12 leds will arrive at #1.<br />The controller of #1 will remove the first data block and set the the 3 leds of that LED block, since they were intended for #1 anyway.<br />After that controller #1 passes the remaining 11 data blocks to the 2nd led block.</p>
<p>The led controller of #2 will do the same thing: remove the first data block, set the leds, and pass on the remaining data (10 data blocks) and pass it on to #3, etc.</p>
<p>So the speed in which this happens, is your limiting factor. So this part is something we cannot really influence that much.</p>
<p>Now when putting 2 smaller strips in parallel, you'd actually get the exact same speed (theoretically anyway).</p>
</blockquote>
<p>Hello @hans, with regards to this discussion, you correctly mentioned one of the downside's of the WS2812 is the time needed to pass the data along the chain.<br />All of the data for each of the three colours in each LED is written serially, in sequence, along a single data line, which means that there is a finite time between each LED along the string receiving it's command and updating. For long strings of LEDs that can become noticeable, however, it takes a very long string.</p>
<p>Earlier in this topic you quoted this information from the FastLED documentation:</p>
<blockquote>
<p><span>WS2812 strips are slow for writing data, with a data rate of just 800khz, it takes 30µs to write out a single led's worth of data.</span></p>
</blockquote>
<p>Link:<span> </span><a href="https://github.com/FastLED/FastLED/wiki/Parallel-Output" rel="nofollow">https://github.com/FastLED/FastLED/wiki/Parallel-Output</a></p>
<p> </p>
<p>In electronics terms, 30us (that's microseconds, or 1/1,000,000 second) is certainly not fast, but it's pretty instantaneous in terms of human perception (I remember reading somewhere that human perception is limited to ~10ms).<br />Based on this timing, if you were to use a string of 1,000 LEDs, the time between the first LED and last LED receiving their commands would be ~30ms (30/1,000 seconds, or 0.03s). If you were watching these LEDs very carefully, you might be able to see this delay, but it will still appear to be very fast.</p>
<p>So, your comments above are correct, but the effects only become perceptible to most users once you begin to create very long strings. If you are only creating strings of a few hundred LEDs, this affect should never be noticed.</p>
<p>Thanks,<br />David</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>davidl</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/paged/2/#post-2428</guid>
                    </item>
				                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/paged/2/#post-2394</link>
                        <pubDate>Thu, 23 Jul 2020 10:39:51 +0000</pubDate>
                        <description><![CDATA[Awesome haha! 😉 👍]]></description>
                        <content:encoded><![CDATA[<p>Awesome haha! 😉 👍 </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/assistance-request-with-arduino-led-sketch/paged/2/#post-2394</guid>
                    </item>
				                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/paged/2/#post-2390</link>
                        <pubDate>Wed, 22 Jul 2020 16:02:10 +0000</pubDate>
                        <description><![CDATA[I think I answered my own question by making this chnage:
 
void loop() {
colorWipe(0xe9, 0xe9, 0xe9, 200);}]]></description>
                        <content:encoded><![CDATA[<p>I think I answered my own question by making this chnage:</p>
<p> </p>
<p>void loop() {</p>
<p>colorWipe(0xe9, 0xe9, 0xe9, 200);<br /><br />}</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>saeidans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/paged/2/#post-2390</guid>
                    </item>
				                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/#post-2389</link>
                        <pubDate>Wed, 22 Jul 2020 15:40:20 +0000</pubDate>
                        <description><![CDATA[I just tested the filling and turning off LEDs , it seems there is a 3 second delay between each cycle.
is there a way to get rid of it?]]></description>
                        <content:encoded><![CDATA[<p>I just tested the filling and turning off LEDs , it seems there is a 3 second delay between each cycle.</p>
<p>is there a way to get rid of it?</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>saeidans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/#post-2389</guid>
                    </item>
				                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/#post-2380</link>
                        <pubDate>Tue, 21 Jul 2020 10:36:53 +0000</pubDate>
                        <description><![CDATA[Filing and then turning off the LEDs from the outside could be done with something like this:
for (int i = 0; i &lt; (NUM_LEDS / 2); ++i) {  leds=leds = CRGB(red, green, bl...]]></description>
                        <content:encoded><![CDATA[<p>Filing and then turning off the LEDs from the outside could be done with something like this:</p>
<pre><span>for (int i = 0; i &lt; (NUM_LEDS / 2); ++i) {</span><br /><span>  leds=leds = CRGB(red, green, blue);</span><br /><span>  FastLED.show();</span><br /><span>  delay(SpeedDelay);</span><br /><span>}</span><br /><br /><span>for (int i = 0; i &lt; (NUM_LEDS / 2); ++i) {</span><br /><span>  leds=leds = CRGB(0, 0, 0);</span><br /><span>  FastLED.show();</span><br /><span>  delay(SpeedDelay);</span><br /><span>}</span></pre>
<p>The "<span>FastLED.clear()" blanks them all, so you'd want to remove that line.</span></p>
<p>Selecting an effect based on what button has been pressed could be done with something like this (use "#define buttonPin1 10" to define the pins used for the buttons):</p>
<pre>void setup() {<br />  // set pins to be able to read an inpiut<br />  pinMode(buttonPin1, INPUT);<br />  pinMode(buttonPin2, INPUT);<br />  pinMode(buttonPin3, INPUT);<br />}<br /><br /><span>void loop() {</span><br />  int button1State = digitalRead(buttonPin1);<br />  int button2State = digitalRead(buttonPin2);<br />  int button3State = digitalRead(buttonPin3);<br /><br />  if (button1State == HIGH) {<br />  // start effect 1<br />  } else if (button2State == HIGH) {<br />  // start effect 2<br />  } else if (button3State == HIGH) {<br />  // start effect 3<br />  }<br /><br />...<span></span><br /><br />}</pre>
<p>Note that this approach could come with little issues - for example when multiple buttons were pressed.<br />More details on reading buttons: <a href="https://www.arduino.cc/en/tutorial/button" target="true">Arduino - Button</a>.</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/assistance-request-with-arduino-led-sketch/#post-2380</guid>
                    </item>
				                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/#post-2377</link>
                        <pubDate>Mon, 20 Jul 2020 16:05:18 +0000</pubDate>
                        <description><![CDATA[@hans
I need your help again
I want to make few chnages to the code
1- the leds are currently turing on from outside to center and suddenly turn off. I want them to turn of in same sequen...]]></description>
                        <content:encoded><![CDATA[<p>@hans</p>
<p>I need your help again</p>
<p>I want to make few chnages to the code</p>
<p>1- the leds are currently turing on from outside to center and suddenly turn off. I want them to turn of in same sequence.</p>
<p>turn on from out to center then turn off from out to center</p>
<p> </p>
<p>2- I want to be able to add multipe effects in my code by reading diffrent digital pin</p>
<p>for exmple if pin 10 = High then turn on lead from 0 to 11 and if pin== High then turn on LED 11 to 1  ( imagine these effects are going to be used in car turn signal )</p>
<p> </p>
<p>Thanks</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>saeidans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/#post-2377</guid>
                    </item>
				                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/#post-2194</link>
                        <pubDate>Thu, 11 Jun 2020 21:18:34 +0000</pubDate>
                        <description><![CDATA[Cool! 👍]]></description>
                        <content:encoded><![CDATA[<p>Cool! 👍 </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/assistance-request-with-arduino-led-sketch/#post-2194</guid>
                    </item>
				                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/#post-2193</link>
                        <pubDate>Thu, 11 Jun 2020 19:52:17 +0000</pubDate>
                        <description><![CDATA[@hans
bits me
My brother who is a software engineer told me do it this way.
He said C language is a bit different. this is going to be sequence in which the LEDs will turn on
0 and 11
1...]]></description>
                        <content:encoded><![CDATA[<p>@hans</p>
<p>bits me</p>
<p>My brother who is a software engineer told me do it this way.</p>
<p>He said C language is a bit different. this is going to be sequence in which the LEDs will turn on</p>
<p>0 and 11</p>
<p>1 and 10</p>
<p>2 and 9</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>. </p>
<p>in previous code the there was a confusion on what the program should do with number LED of 12 in the formula, or something like that.</p>
<p> </p>
<p>Here is the whole code for your reference:</p>
<p>#include "FastLED.h"</p>
<p>#define NUM_LEDS 12<br />#define PIN 7</p>
<p>CRGB leds;</p>
<p>void setup() {<br />FastLED.addLeds&lt;WS2812, PIN, GRB&gt;(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );<br />}</p>
<p>void loop() {<br />colorWipe(0xe9, 0xe9, 0xe9, 150);<br />colorWipe(0x00, 0x00, 0x00, 150);<br />}</p>
<p>void colorWipe(byte red, byte green, byte blue, int SpeedDelay) {</p>
<p>FastLED.clear();<br /><br />for (int i = 0; i &lt; (NUM_LEDS / 2); ++i) {<br />leds=leds = CRGB(red, green, blue);<br />FastLED.show();<br />delay(SpeedDelay);<br />}</p>
<p>FastLED.clear(); // alternative: fill_solid(leds, NUM_LEDS, CRGB(0,0,0));<br />FastLED.show();<br />}</p>
<p> </p>
<p> </p>
<p>Thanks again</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/arduino/">Arduino</category>                        <dc:creator>saeidans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/#post-2193</guid>
                    </item>
				                    <item>
                        <title>RE: Assistance request with Arduino LED sketch</title>
                        <link>https://www.tweaking4all.com/forum/arduino/assistance-request-with-arduino-led-sketch/#post-2192</link>
                        <pubDate>Thu, 11 Jun 2020 19:46:22 +0000</pubDate>
                        <description><![CDATA[Oh wait,... I see where things went sideways,...
 
In my code I made a calculation mistake in this section:
leds          = CRGB(red, green, blue);leds = CRGB(red, green, b...]]></description>
                        <content:encoded><![CDATA[<p>Oh wait,... I see where things went sideways,...</p>
<p> </p>
<p>In my code I made a calculation mistake in this section:</p>
<pre>leds          = CRGB(red, green, blue);<br />leds = CRGB(red, green, blue);</pre>
<p>See, the leds are counted as such (0,1,2,3,4,5,6): </p>
<p>0 and 12 (12-0 = 12, which is 1 too many)<br />1 and 11 (12-1)<br />2 and 10 (12-2)<br />3 and 9 (12-3)<br />4 and 8 (12-4)<br />5 and 7 (12-5)<br />6 and 6 (12-6)<br /><br /></p>
<p>This however should have been (0,1,2,3,4,5):</p>
<p>0 and 11 (to get 11: 12-1)<br />1 and 10 (12-2)<br />2 and 9 (12-3)<br />3 and 8 (12-4)<br />4 and 7 (12-5)<br />5 and 6 (12-6)</p>
<p>So the counter went to far as well both sides counted out of pace.</p>
<p> 👍  Your solution fixed that! Excellent find! 👍 </p>
<p> </p>
<p>Just for completeness, my own code corrected:</p>
<pre>#include "FastLED.h"<br /><br />#define NUM_LEDS 12<br />#define PIN 7<br /><br />CRGB leds;<br /><br />void setup() {<br />  FastLED.addLeds&lt;WS2812, PIN, GRB&gt;(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );<br />}<br /><br />void loop() {<br />  colorWipe(0xe9, 0xe9, 0xe9, 150);<br />}<br /><br />void colorWipe(byte red, byte green, byte blue, int SpeedDelay) {<br /><br />  FastLED.clear();<br /><br />  for (int i = 0; <span style="color: #ff0000"><strong>i &lt; (NUM_LEDS / 2)</strong></span>; i++) {<br />    leds = CRGB(red, green, blue);<br />    <strong><span style="color: #ff0000">leds</span></strong> = CRGB(red, green, blue);<br />    FastLED.show();<br />    delay(SpeedDelay);<br />  }<br /><br />  FastLED.clear(); // alternative: fill_solid(leds, NUM_LEDS, CRGB(0,0,0));<br />  FastLED.show();<br />}</pre>]]></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/assistance-request-with-arduino-led-sketch/#post-2192</guid>
                    </item>
							        </channel>
        </rss>
		