Thanks .
This works too. Now that I'm looking at things differently.
Last input of pattern. Blacked LED 1 and 8.
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
HAHA I just twigged this is what you told me in the first place!!!!!!!!!!!
Thanks .
This works too. Now that I'm looking at things differently.
Last input of pattern. Blacked LED 1 and 8.
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Thanks Mate. I will have a play around with it. I will post a video of your modified code in action. I think it looks good and more importantly I understand why things are happening.
PS
I spotted your deliberate mistake in last code.
😉
Cheers,
Davy.
What is the purpose of the final empty for loop (for j=0 to 9) ?
Anything seems possible when you don't know what you're talking about.
How are your leds wired up you don't seem to be using an rgb led strip?
You seem to be getting the idea with the for loops. The FastLED library has a lot more to offer and probably worth your while looking at some examples of its use online.
What is the purpose of the final empty for loop (for j=0 to 9) ?
Slackness on my part. Would have had another loop there as I was experimenting and didn't remove complete loop instruction during edit.
😉
How are your leds wired up you don't seem to be using an rgb led strip?
Green is data IN from Arduino via 330 Ohm resistor, which is then piggy backed to following LED and so on. Final pin on final LED is left as is.
There is also a 100 uF capacitor across + and -.
Using individual addressable LEDs.
Cheers,
Davy.
Missed that one! I didn't know you could buy individual addressable rgb leds or that Bill had covered the topic. Making colour led displays just wasn't on my radar.
Mate, further to my previous post....
With your last example you a mixing methods (look up table for values to use vs algorithm to generate those values). I would recommend that you learn to use algorithms. Lists and tables have a use but they aren't teaching you how to improve your programming.
For example if you want two different colours to pass each other you might think how to compute the second led position from the position of the led moving right.
ledNumber1: 0 1 2 3 4 5 6 7 8 9
ledNumber2: 9 8 7 6 5 4 3 2 1 0Notice that ledNumber2 = 9 - ledNumber1
In this example the red moves left to right while the green moves right to left. This is repeated.
So the bouncing effect IE when one colour starts at 0 to 4 and second colour starts from 9 to 5 would look like this?
ledNumber1: 0 1 2 3 4 4 3 2 1 0
ledNumber2: 9 8 7 6 5 5 6 7 8 9
If so, how is this applied?
Thanks,
Davy.