Go Down

Topic: fadeStep/ fadeDelay error messages, What do I do ? (Read 708 times) previous topic - next topic

03coupr

/* RGB Fading Example

*/


int RLedPin = 11;       // Red LED connected to PWM digital 11
int GLedPin = 10;       // Green LED connected to PWM digital 10
int BLedPin =  9;       // Blue LED connected to PWM digital 9
int fadeDelay = 5;
int fadeStep  = 1;

void setup()    {    // do nothing here
}

void loop()    {
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=fadestep)  {
    analogWrite(RLedPin, fadeValue) ;
    delay(fadeDElay) ;
  }
  for(int fadeValue = 0 ; fadeValue >= 255; fadeValue +=fadestep)  {
    analogWrite(RLedPin, fadeValue) ;
    delay(fadeDElay) ;
  }
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=fadestep)  {
    analogWrite(GLedPin, fadeValue) ;
    delay(fadeDElay) ;
  }
  for(int fadeValue = 0 ; fadeValue >= 255; fadeValue +=fadestep)  {
    analogWrite(GLedPin, fadeValue) ;
    delay(fadeDElay) ;
  }
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=fadestep)  {
    analogWrite(BLedPin, fadeValue) ;
    delay(fadeDElay) ;
  }
  for(int fadeValue = 0 ; fadeValue >= 255; fadeValue +=fadestep)  {
    analogWrite(BLedPin, fadeValue) ;
    delay(fadeDElay) ;
  }
}

wildbill

case is important. fadestep is not the same as fadeStep

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy