Hi
I have a 5 meter APA102 strip (30led/meter)
I would like to make a effect of randomly moving pixels around the strip (random number of pixels 1–5 moving from top to bottom)
Random number of pixels ON
Random number of pixels OFF
Random number of pixels ON
Random number of pixels OFF
.
.
.
.
and so on
Moving around the strip
Could you please advise where to start with
Is there any example code available.
I am using Arduino Mega and Fastled
Thanks
Break the animation idea you want down into parts. Here’s my initial ideas of how I might go about it.
use a Boolean variable to switch between sending On or Off pixels.
select a random number of 1-5. Store that in a variable called count.
set leds[0] on or off based on Boolean variable.
shift all the pixels down the string one position.
subtract one from count
if count is still greater then 0, then set leds[0] on or off based on Boolean. If count has reached 0, then it’s time to toggle Boolean state and choose a new random number for count.
Use a EVERY_N_MILLISECONDS block to control the speed.
I would also recommend downloading and running some of the >>>plethora<<< of available (and Googleable) examples that have been published and then going from there. To me, the best way to learn is to see what already works then then muck around with it.
I didn’t even think about writing my own routines until I had exhausted all of the ones that had already been published…
Oh, and like Marc says, break things up and start small.
I have created the code to move random pixels using the link(jeremy williams) and your ideas provided. It was really helpful.
Please look at the video
I would like to blend the blue random pixel drop through green pixels at the end of the strip(I should be able to see the blue pixels drop right till the end of the strip).
Also the green pixels at the end
should be gradient in brightens(pixel 144 through pixel 124 brightness is 100% to 25%)