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;
} //Return the added Value
if(bri == 1){
for(byte brightness = 0; brightness < 255; brightness++){
analogWrite(red, brightness);
delay(150);
}
}
}