Programming error

I am getting an error (expected primary-expression before’)’ token

I can’t see it.

Can you help me please. Thanks Frank G.

// Fade an LED in and out like on a sleeping Apple computer

const int LED = 1; // the pin for the LED
int i = 0; // We’ll use this to count up and down

void setup(){
pinMode(LED, OUTPUT); // tell Arduino LED is an output
}

void loop(){
for(i = 0; i < 255; i + +){ // loop from 0 to 254 (fad out)
analogWrite(LED, i); // set the LED brightness
delay( 10); // Wait 10ms because analogWrite
} // is instantaneous and we would
// not see any change
for (i = 255; i > 0; i–){ // loop from 255 to 1 (fade in)
analogWrite( LED, i); // set the LED brightness
delay( 10); // Wait 10ms
}
}

You can't have spaces in the middle of a multi-character operator name. You wrote "i + +" where you meant "i ++".

:slight_smile:

Thank you so much. First time I mad that one.

It funny how one spends more time on errors than the code.

Thanks again

Frank G.