# Fade in and Out LED Help

I am honestly a newbie to this whole thing. So the follow problem may be very simple to fix. Currently; I am trying to have an RGB LED slowly fade in and out while alternating colors between fades. I designed this code with hopes that as the bri int gets higher, it changes the color that is faded in as well as fading out the already existing color. This is the code I have for it so far, that only fades in and out with red to make sure my equation works corrently. The error that I am receiving is: "exit status 1 expected constructor, destructor, or type conversion before ‘(’ token"

``````int redPin = 9;
int greenPin = 10;
int bluePin = 11;
int bri = 0;
int red = redPin;
int green = greenPin;
int blue = bluePin;

void setup(){
pinMode(red, OUTPUT);   //Initlaize the RGB LED pins
pinMode(green, OUTPUT);
pinMode(blue, OUTPUT);
}

void loop(){
Brighten(1000,5);   //Loop through the brighten funcion

}

Brighten(bri, int x){    //Add 1 to Bri
if(bri == 0);{
x = 1;
bri + 1;
return value;
if(bri == 1){
for(byte brightness = 0; brightness < 255; brightness++){
analogWrite(red, brightness);
delay(150);
}
}
}
``````

In your function Brighten() bri starts with 1000 so all your if statements resolve false

``````void loop() {
Brighten(1000, 5);  //Loop through the brighten function

}

Brighten(bri, int x) {   //Add 1 to Bri
// bri starts at 1000 passed from Brighten(1000, 5);
if (bri == 0); { // false
}
if (bri == 1) { // false
}
// nothing happens!!!!!!!!!!!
}
``````
``````if (bri == 0);
``````

Lose the semicolon.

``````bri + 1;
``````

Test the value of the expression "bring" plus one, and discard the result.

Pointless.

``````void loop() {
Brighten(1000, 5);  //Loop through the brighten function

}

Brighten(bri, int x)
``````

Code (sort-of) outside a function?