Hi Guys I've been trying for several days now to come up with some code that will randomly blink two leds (separately) without using delay. I prefer to use the word flash than blink, as I need each led to have a different on interval to its off interval and the intervals need to be different each time. The final result I'm after is to be able to simulate a couple faulty fluorescent tubes - you know the effect, that annoying unpredictable period flashing that occurs when the starter goes on them! I can't use delays because this code segment needs to be added to an existing sketch, which is already controlling sets of leds (with millis) and needs to be unaffected by this addition.
I do know how to blink an led without delay, [u]but[/u] only if the intervals are fixed, its just how to change the length of each interval between every flash that eludes me. If I define a random interval in setup it uses the one value it calculates for each and every flash, but if I define the interval inside the loop it continually changes before the leds have a chance to flash and so never do flash. I can't see a way of changing the intervals only after the led has flashed, every time. I don't have any code to post yet because this is just an idea at the moment.
Can anyone suggest a method of achieving the effect I'm after? I hope all that makes sense!