/* Fade This example shows how to fade an LED on pin 9 using the analogWrite() function. This example code is in the public domain. */ byte led = 9 ; // the pin that the LED is attached to byte brightness = 0; // how bright the LED is // the setup routine runs once when you press reset: void setup() { // declare pin 9 to be an output: pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: void loop() { // set the brightness of pin 9: analogWrite(led, brightness++); delay(10); }