// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 9:
analogWrite(ledPin, brightness);
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

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