It WONT STOOOP!

Ah well alrighty then. If you promise to read my links in the previous post :slight_smile:

No promises though, but it compiles here without errors.

const int ledPinR = 9;
const int ledPinG= 11;
const int ledPinB = 10;

const int buttonPin1 = 3;

int buttonState1 = 0;

byte redPwr = 0;
byte greenPwr = 0;
byte bluePwr = 0;

void fade(int, int, int, int); // forgot to mention you must declare a function prototype first (I think), or simply put the hole function here.

void setup()
{
  pinMode(ledPinR, OUTPUT);
  pinMode(ledPinG, OUTPUT);
  pinMode(ledPinB, OUTPUT);


  pinMode(buttonPin1, INPUT);



}
void loop()
{
  buttonState1 = digitalRead(buttonPin1);
  if (buttonState1 == LOW){
    delay(200);
    redPwr = 246;
    greenPwr = 235;
    analogWrite(ledPinR, redPwr);
    bluePwr = 0;
    analogWrite(ledPinG, greenPwr);
    analogWrite(ledPinB, bluePwr);
    fade(redPwr,greenPwr,bluePwr,25);
    delay(500);

  }
    else {
    analogWrite(ledPinR, LOW);
    analogWrite(ledPinG, LOW);
    analogWrite(ledPinB, LOW);
  }
}
void fade(int redFrom, int grnFrom, int bluFrom, int delayTime)
{
   for (int r=redFrom, g=grnFrom, b=bluFrom; r>=0; r-=5, g-=5, b-=5)
   {
      digitalWrite(ledPinR, r);
        digitalWrite(ledPinG, g);
        digitalWrite(ledPinB, b);
        delay(delayTime);
   }
}

Note: Regarding the function declaration (the line "fade(int, int, int, int);" at the top, I'm not sure if it is a must after all - it compiles without it.