Fading Multiple LEDs at once

Badically, I have multiple LEDs that I want to fade in and out at the same time to create a fire-like effect.

I currently have it so each LED fades out individually but can’t seem to combine them in any way. Any help would be appreciated.

// Fading LED

int value = 0; // variable to keep the actual value
int ledpin1 = 11;
int ledpin2 = 9;
int ledpin3 = 6;
int ledpin4 = 7;
int ledpin5 = 3;
int ledpin6 = 5;
// light connected to digital pin 9

void setup()
{
// nothing for setup
}

void loop()
{
for(value = 0 ; value <= 255; value+=5) // fade in (from min to max)
{
analogWrite(ledpin1, value); // sets the value (range from 0 to 255)
delay(30); // waits for 30 milli seconds to see the dimming effect
}
for(value = 255; value >=0; value-=5) // fade out (from max to min)
{
analogWrite(ledpin1, value);
delay(30);
}
for(value = 0 ; value <= 255; value+=5) // fade in (from min to max)
{
analogWrite(ledpin2, value); // sets the value (range from 0 to 255)
delay(30); // waits for 30 milli seconds to see the dimming effect
}
for(value = 255; value >=0; value-=5) // fade out (from max to min)
{
analogWrite(ledpin2, value);
delay(30);
}

for(value = 0 ; value <= 255; value+=5) // fade in (from min to max)
{
analogWrite(ledpin3, value); // sets the value (range from 0 to 255)
delay(30); // waits for 30 milli seconds to see the dimming effect
}
for(value = 255; value >=0; value-=5) // fade out (from max to min)
{
analogWrite(ledpin3, value);
delay(30);
}

for(value = 0 ; value <= 255; value+=5) // fade in (from min to max)
{
analogWrite(ledpin4, value); // sets the value (range from 0 to 255)
delay(30); // waits for 30 milli seconds to see the dimming effect
}
for(value = 255; value >=0; value-=5) // fade out (from max to min)
{
analogWrite(ledpin4, value);
delay(30);
}

for(value = 0 ; value <= 255; value+=5) // fade in (from min to max)
{
analogWrite(ledpin5, value); // sets the value (range from 0 to 255)
delay(30); // waits for 30 milli seconds to see the dimming effect
}
for(value = 255; value >=0; value-=5) // fade out (from max to min)
{
analogWrite(ledpin5, value);
delay(30);
}
for(value = 0 ; value <= 255; value+=5) // fade in (from min to max)
{
analogWrite(ledpin6, value); // sets the value (range from 0 to 255)
delay(30); // waits for 30 milli seconds to see the dimming effect
}
for(value = 255; value >=0; value-=5) // fade out (from max to min)
{
analogWrite(ledpin6, value);
delay(30);
}
}

plug all the LEDs into the same pin. i had 5 leds on my bare bones fade all at once.

I have about 14 LEDs (most of them are soldering together in a group of 2 or 3).

heres a vid. i just took.

anyone else have an idea besides putting them in 1 pin?

As robochan mentioned, you could put them all on the same pin. But you can also change your code. Right now, you code for one pin to fade in, then fade out. Then you go to the next pin. You need to do all the pins simultaneously.

 for(value = 0 ; value <= 255; value+=5) // fade in (from min to max) 
 { 
   analogWrite(ledpin1, value);           // sets the value (range from 0 to 255) 
   analogWrite(ledpin2, value);           // sets the value (range from 0 to 255) 
   analogWrite(ledpin3, value);           // sets the value (range from 0 to 255) 
   analogWrite(ledpin4, value);           // sets the value (range from 0 to 255) 
   analogWrite(ledpin5, value);           // sets the value (range from 0 to 255) 
   analogWrite(ledpin6, value);           // sets the value (range from 0 to 255) 
   delay(30);                            // waits for 30 milli seconds to see the dimming effect 
 } 
 for(value = 255; value >=0; value-=5)   // fade out (from max to min) 
 { 
   analogWrite(ledpin1, value); 
   analogWrite(ledpin2, value); 
   analogWrite(ledpin3, value); 
   analogWrite(ledpin4, value); 
   analogWrite(ledpin5, value); 
   analogWrite(ledpin6, value); 
   delay(30); 
 }

Good luck!

Wow thank you so much! ;D It works perfectly!

see i dont know how to program. its just not comming to me like building stuff dose.

That's fine. Your hardware solution would have worked too.

Programming is like anything else. Practise makes perfect :) Or you could always team up with a software guy, and you both can handle your area of expertise.

iv only known about arduino for a week. ill get i sooner or later.