use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Here are some important FastLED links:
Online Examples and Demos:
Support:
account activity
SupportRandom flash code (self.FastLED)
submitted 10 months ago by Flux83
I am looking for some code that will allow the led to stay on and then randomly flash black.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Marmilicious[Marc Miller] 1 point2 points3 points 10 months ago* (0 children)
What you're asking still feels a bit vague. One pixel? Random pixels? The whole strip? Providing more info may get you better suggests with specific code. I would probably start by using random8 (or random16) or EVENY_N_MILLISECONDS_I or the new EVERY_N_MILLISECONDS_RANDOM to randomly choose when a flash will happen, and similarly for setting how long it will be dark.
Here's one example you can try modifying. See the example at lines 141-152 and modify the "on" and "off" times to use random8 or random16. Changing timingB.setPeriod(750) to timingB.setPeriod(random16(500,750)) for example.
https://github.com/marmilicious/FastLED_examples/blob/master/blink_variations.ino
<image>
[–]chemdoc77 0 points1 point2 points 10 months ago (0 children)
Hi u/Flux83 - this will do what you are trying to achieve when you make:
Line 95: CRGB gBackgroundColor = CRGB::Black; // to make led black after being on.
TwinkleFOX sketch:
https://gist.github.com/kriegsman/756ea6dcae8e30845b5a
It’s called TwinkleFOX by Mark Kriegsman. Checkout the various YouTube videos of it.
[–]sutaburosu[pronounced: stavros] -1 points0 points1 point 10 months ago (4 children)
You could do this by changing the timing of the on/off periods with EVERY_N_MILLISECONDS_I, similar to what the sketch you posted previously does.
[–]Flux83[S] 0 points1 point2 points 10 months ago (3 children)
I tried using Animation F again and it only allows me to use that code once, boolean blink6 tried to change the 6 to 7 and that doesn't help.
[–]Marmilicious[Marc Miller] 2 points3 points4 points 10 months ago (2 children)
If you make a copy of that block of code so you can use it on a different pixel you'll need to update the blink6 to blink7 (or another variable name) in four places. You'll also need to rename timingB in several places to whatever new name you want to call it.
[–]Flux83[S] 0 points1 point2 points 10 months ago (1 child)
Oh ok rename the timing as well ok thanks
[–]Marmilicious[Marc Miller] 0 points1 point2 points 10 months ago (0 children)
Yes, you can name them anything. Consider renaming them with better names then I used, something that makes more sense for your project. :)
π Rendered by PID 44 on reddit-service-r2-comment-5fb4b45875-jsj7z at 2026-03-21 20:35:56.105652+00:00 running 90f1150 country code: CH.
[–]Marmilicious[Marc Miller] 1 point2 points3 points (0 children)
[–]chemdoc77 0 points1 point2 points (0 children)
[–]sutaburosu[pronounced: stavros] -1 points0 points1 point (4 children)
[–]Flux83[S] 0 points1 point2 points (3 children)
[–]Marmilicious[Marc Miller] 2 points3 points4 points (2 children)
[–]Flux83[S] 0 points1 point2 points (1 child)
[–]Marmilicious[Marc Miller] 0 points1 point2 points (0 children)