//Asketch to fade the brightness of an LED
//Variables to hold the pin numbers.
byte ledPin_1 = 6;
byte ledPin_2 = 9;
byte ledPin_3 = 11;
//Global variable to hold the brightness
byte brightness = 0;
//Setup will only run once.
void setup() {
}
//Loop will run over and over.
void loop()
{
//Local variable, increment to fade by.
byte fadeAmount = 1;
//Local variable, delay time between switching
int delayTime = 5;
analogWrite(ledPin_1, brightness);
brightness = brightness + fadeAmount;
delay(delayTime);
delay (delayTime);
analogWrite(ledPin_2, brightness);
brightness = brightness + fadeAmount;
delay(delayTime);
analogWrite(ledPin_3, brightness);
brightness = brightness + fadeAmount;
delay(delayTime);
}