hello all i have now been playing about for what feel likes ages and dont seem to be getting any where, I have been play around the “cylon example”. i have stripped the code back and played around, What i am trying to do is get at sweep of lights from each end of the strip to the middle, My code seems to run one side one dot at a time, each time the loop runs (all leds) on one side the other side only moves once. (i dont want the back and forward motion) i have shorted total leds used for speed, can some please cast a eye over my code and point me in the right direction (still new to coding)
Still been playing with my code, What i am now trying to do is as the dot fills once to the center i want all leds to turn off i have been trying to use
if (i>149);
set[Num_LED] (0,0,0) **or somthing like this My full code so far *************************************
Thanks JP Roy, code is coming together and I getting a much better understanding on what I am doing, one thing I was thinking (I don’t want the answer yet) is it possible to increase the delay mid loop, what I was thinking how can I get the dot the speed up each time the loop is repeated till the end of the strip, dose this make since I want a dot starts slow and ends fast. Can you point me where to start so I can learn
Many thanks Wayne
@wayne_hemmings yes of course it is possible. Instead of using a constant integer in the line…
delay (20);
you should use a variable such as…
delay (myDelay);
First declare that variable near the top of your sketch, before the setup(). Since you do not want that variable to ever be a negative number I would suggest…
unsigned int myDelay = 20; // or any other number
Then, somewhere inside your… for (int i = 0; i<149; i++) loop , you increase or decrease that variable as you want.
My best advice would be to go through some Arduino tutorial that can be found on YouTube, there are many !!
Also go through the example sketches that come with Arduino and the FastLED library and play, modify them to understand how they work.
If you get stuck, just come back here with a clear problem description, I or someone else within this forum may help.