I think I understand the code, but new. I'm trying to write a program that at a button press will cause LEDs to randomly flicker, fade, brighten and then come back up to full brightness. The base code is below and taken and modified from an instructable. I know how to add a button later as well as the full brightness but I wanted to know if anyone had any better way than this, plus I'm not near my code examples and on a phone typing this: up
// LED Fire Effect
int ledPin1 = 10;
int ledPin2 = 9;
int ledPin3 = 11;
void setup()
{
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
}
void loop() {
analogWrite(ledPin1, random(0)+255);
analogWrite(ledPin2, random(0)+255);
analogWrite(ledPin3, random(0)+255);
delay(random(100));
}