Newcomer Help

Hey im new to Arduino, and im currently working on a project fading multiple LEDs with PWM, and I was wondering how I can assign fade in/out times to be different per PWM pin.

Im looking to have 5 LEDs tied to 5 PWMs, and each pin will be on a different cycle.

I tried using some array’s and frequented the playground, and im still havin trouble.

If any of y’all could help me out, it would be much appreciated.

In the code posted below im just running off of 3 PWMs to see if I can get it to work.

Thanks

int ledpins= {9,10,11}; // LED Pin Array
int pwmspeed = {2000,7000,5000,10000,4500}; // PWMSpeed Array, all set times in millis
int i=0; //place holder for pwmspeedarray
int x = 0; //ledarray place holder
int del =

void setup()
{
for (x=0; x<3; x++)
{
pinMode(ledpins, OUTPUT);
}
}

void loop()
{

for(x=0; x<3; x++)
{
for(i=0; i<5; i++)
{

analogWrite(ledpins, HIGH);
delay = del;

}

}

}

So i haven't tested your code or even tried the setup on my own time (my arduino is currently in the middle of a big project) but that part looks fine. However, I do have to ask how the loop is supposed to work.

You never initialize del, and to call delay you it would be delay(del), or maybe delay(pwmspeed(i)) if pwmspeed is supposed to be the delay time, im not really sure what that is. Also, when you analogWrite you dont use HIGH, the whole idea is you are using a data value from 0 to 255.

I assume you are using the Arduino software, so my best suggestion is to modify the Fading sketch. If you have Ardunio GUI, its is the examples section. If you don't have it, you can get it from http://arduino.cc/en/Tutorial/Fading, which also happens to have steps to follow. Good luck!