int led1=11;
int led2=9;
int brightness = 0; // how bright the LED is
int fadeAmount = 100; // how many points to fade the LED by
void setup() {
// put your setup code here, to run once:
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(led1,HIGH);
analogWrite(led2, 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);
delay(5000);
digitalWrite(led1,LOW);
delay(5000);
}