Pages: [1]   Go Down
Author Topic: fadeStep/ fadeDelay error messages, What do I do ?  (Read 648 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

/* 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) ;
  }
}
Logged

New Jersey
Online Online
Faraday Member
**
Karma: 70
Posts: 3742
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

case is important. fadestep is not the same as fadeStep
Logged

Pages: [1]   Go Up
Jump to: