Go Down

Topic: fadeStep/ fadeDelay error messages, What do I do ? (Read 670 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