Newcomer Help


hey im new arduino, , im working on project fading multiple leds pwm, ,  was wondering how can assign fade in/out times different per pwm pin.

im looking have 5 leds tied 5 pwms, , each pin on different cycle.

i tried using array's , frequented playground, , im still havin trouble.

if of y'all me out, appreciated.

in code posted below im running off of 3 pwms see if can work.

thanks


int ledpins[]= {9,10,11};                           // led pin array
int pwmspeed[] = {2000,7000,5000,10000,4500};                 // pwmspeed array, set times in millis
int i=0;                    //place holder pwmspeedarray
int x = 0;        //ledarray place holder
int del =

void setup()
{
(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 haven't tested code or tried setup on own time (my arduino in middle of big project) part looks fine.  however, have ask how loop supposed work.  

you never initialize del, , call delay delay(del), or maybe delay(pwmspeed(i)) if pwmspeed supposed delay time, im not sure is.  also, when analogwrite dont use high, whole idea using data value 0 255.  

i assume using arduino software, best suggestion modify fading sketch.  if have ardunio gui, examples section.  if don't have it, can  http://arduino.cc/en/tutorial/fading, happens have steps follow.  good luck!


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Newcomer Help


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums