LED Pause problem

Hi Guys,

I'm taking a class on Adruino and I'm having trouble controlling LED timing. I want to Fade an LED (using PWM) to maximum brightness, hold it there for 2 seconds, then fade it out to minimum brightness and delay it 4 seconds. Here's my code. What am i doing wrong?

// this is a modified code, credit for original goes to genius who wrote //the led fade tutorial in the tutorial section on adruino's site

int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by

void setup() {
// declare pin 9 to be an output:
pinMode(9, OUTPUT);
}

void loop() {
// set the brightness of pin 9:
analogWrite(9, brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
if (brightness = 255) {
delay(2000);
if (brightness = 0)
delay(4000);
}
}

Any help would be great
thanks, mo

You just had some garbled if statements at the end. The old double equal sign trick:
if (brightness = 255) { // this should be ==, not =

You also need to make those two if statements separate with brackets { }
You've got the second one inside the first if statement, separate them.