im a newcomer for arduino and sorry for any grammar error. So what im trying to do is replicating a flickering effect found on spacecraft thruster when they about to take off where the fire bursting from dim to bright with flickering,similiar to afterburner on aircraft model which use neopixel led but this time only using common led. I could mimic the flickering on the led with various brightness level using the simple analogWrite,the problem is i cant really merge them since i use delay which is affecting how fast the flickering effect is and i need 1 sequence of flickering to stay a while before going next to brighter flickering and so on. My code is quite too simple
Int led = 9;
void setup () {
pinMode (led, OUTPUT);
}
void loop() {
{analogWrite (led, random (10,15));
delay (30);}
}
Im thinking adding a new line with higher random led states (ex. 50,100) should be okay,but then the delay which affect the flickering speed are too short and making both line merging useless since its will go to the brightest in no time. Is there's any way to hold the first dim line for an amount of time then continue to the next brighter line and so on without affecting the filckering delay? Any help will be appreciated
Thank you!