Circuit #1B: Fading an LED

Ryan Ferguson


// the setup routine runs once when you press reset:

void setup() {

}


// the loop routine runs over and over again forever:

void loop() {


  for(int i=0; i<255; i++){

    analogWrite(11, i);

    delay(10);

  }

  for(int i=0; i>0; i--){

    analogWrite(11, i);

    delay(10);

  }

}